Make sure temp file is created in /tmp or  (not current directory; avoid write failure)