This addresses multiple issues in the NSS caching system, the hilights are:
- the caching loop prevention doesn't work, executables must be compiled -export-dynamic to have their symbols visible to dlsym() a. As a result of this not even working currently, take this opportunity to rename the symbol correctly.
- getgroupmembership() isn't cached at all if a NSS provider (ie LDAP) provides its own version, since that gets intercepted before the fallback is executed
- passwd and group lookups in nscd are not threadsafe a. I started to fix getservent as well before discovering this set uses thread-local-storage to fix it, I briefly debated migrating that to the passwd and group entries but feel this is a superior solution.
- negative cached lookups when using perform_lookups were not properly returned.