Check if the env pointer exists before setting it
Set the effective user and group id only in the constructor