loader: fix leak of child-to-parent links on dlclose()

Use children instead of parents in is_recursive() - this
allows us to remove code adding links from child to
parent when loading a library.

Bug: 36104177
Test: /data/nativetest/bionic-unit-tests/bionic-unit-tests32 --gtest_filter=dl*
Test: manual - dlopen/dlclose libandroid.so 10 times and see how many blocks are
      used after each dlclose() - make sure they are constant.

Change-Id: I776d47de92101c6ba47f400205ccbfe8844a7cb8
1 file changed