fix_parent_loop: set node parent only after checking conditions

As per https://github.com/jmgq/php-a-star/issues/2

example2.php is the new test case, which hangs before the patch, but runs correctly after it.

Successor node parent is now not updated until checks are done regarding open/closed lists and scores.