real_main: Use setenv() instead of putenv() in remaining places