Temporary file creation should respect $TMPDIR

This applies to [exec] and [file tempfile]

Reported-by: Jakub Wilk
Signed-off-by: Steve Bennett <steveb@workware.net.au>