Replace unsetenv() and setenv() with older putenv().