Fix $HOME and $USER variables in case the script is run using sudo and impersonation