Address some issues with test runs on linux systems.

1) Don't assume there is a TMPDIR in the environment.
2) Don't assume the umask is anything specific.