More fixes to error handling in getlogin_r.