fix_parent_loop: set node parent only after checking conditions, example2 test case
Revert "fix_parent_loop: set node parent only after checking conditions, example2 test case"

This reverts commit 569233a15b497fb2381dda3df931cbc1bc64da19.
Add failing test for circular links
Fix an infinite loop in nodes with circular refs.

Prior to this commit, the algorithm would enter in an infinite loop when
trying to retrieve a solution (path) that included a starting node with
a circular reference to its parent.

This fixes issue #2.