Adjust so undefined environment variables are not used.

This means our test cases run, which is great (previously they would
fail as local woudl localise the value to undef, but leave the env
keys in place).

As far as I know, there's no concept of an 'undefined' value when it
comes to real env variables (the least they can be is an empty string),
so this change makes testing easier with no change in functionality. :)