Since change I882b16a9 added the possibility to rebase one change onto
another change it's very easy to introduce dependency loops.
Considering the following scenario, where C2,PS1 depends on C1,PS1:
master ----- (C1,PS1) ----- (C2,PS1)
Until this patch it was possible to rebase C1,PS1 onto C2,PS1 resulting
in the following recursive dependency:
master ----- (C1,PS1) ----- (C2,PS1) ----- (C1,PS2)
This patch blocks recursive rebase attempts from the UI and REST API.
Change-Id: Id8fbb1b34580df8eebf6ae7f1963a4d7acb05fe8