the wrong condition was used in determining the presence of a result that needs space/copying for the _r functions. a zero return value does not necessarily mean success; it can also be a non-error negative result: no such user/group.
this allows getpwnam and getpwuid to share code with the _r versions in preparation for alternate backend support.
these changes are a prerequisite to making stdio cancellable.