rtld: Fix gethints()
The function that retrieves the hints file contents had a logic flaw.
It's supposed to return either the full or filtered version of the
hints file depending if the object has the nodefaultlib flag set or
not. The problem was that every subsequent call would return the
first call's result regardless of the nodefaultlib flag setting.
The function's API was changed to simplify the code. The function is
never called without a valid object, so there was no need to test for
that in order the check the nodefaultlib flag. Now the flag is passed
to gethints() directly.
Reported and submitted by: Konstantin Belousov