Redmine #5721: Fix users promises getting confused by NIS or NSS.

getpwnam() will return remote user information if NIS or NSS is
configured as the primary user DB, but we want it to return local user
information. Fix by opening /etc/passwd manually and using
fgetpwent().
Merge pull request #1712 from kacfengine/users_promises_fixes

Redmine #5721: Fix users promises getting confused by NIS or NSS.