RM3979: reworked a test to use putenv() instead of setenv().

We can't use setenv because it doesn't exist on Solaris.