Handle #4 with SUDO_USER instead of TTY lookup.

The TTY might not be available (if input is piped). The use of
`who am i` was basically a work around for `sudo`, in any event.