Use pam_env to properly setup system-wide env

This is the _proper_ fix of  #2688.