Today, a number of tests use fixed paths in /tmp for their temporary file objects. Similar to #574, this presents problems in shared and/or sandboxed test environments, where tests may conflict with other runs or fail due to the lack of access to /tmp. We should use a standard API for accessing the temp path at various code sites where these paths are created (e.g. something like TestEnvironment::tempPath()) and also make the implementation of this respect variables like TMPDIR.