Set safe environment before going root.

Previously a safe environment was set for any external commands,
but the provided environment was used to actually look up those
commands, which left us vulnerable to environment manipulation. We
now set our own environment before going root, consisting of just a few
necessaries.
Set safe environment first.

Not sure if this makes much difference, but it might...