forbid self-cyclic links

Signed-off-by: Daniel A. Zorin <juan@lvk.cs.msu.su>