Merge from 4.2.3. fix for TRQ-1963: TMPDIR not set when using $tmpdir.