Bug 1014768 - the previous logic could not properly distinguish usernames that begin with numbers and called Etc.getpwnam too often.