more reliable way to look up username

`ENV` is manipulable.  `getpwuid` is reliable.
Merge pull request #3076 from rolandwalker/user_from_etc

more reliable way to look up username