Add errno=0 before calling getpwnam() in previous patch.