Fix PAM-called scripts for when environment variables are unavailable

Sometimes, $USER and $HOME are unset in the PAM-run scripts (running through
SSH in particular).