libc: implement passwd handling functions

We have already some of the user handling functions, but not others, like
getpwent, endpwent, and their group variants.

Those functions read entries from the passwd file, and we can emulate them
easily, by just keeping a counter of whether or not we should return our single
user/group, or go back to the beginning of the file. Those functions are not
reentrant.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>