Implement `getpwnam` in terms of `getpwent`, `setpwent` and `endpwent`.