[#6256] use TMPDIR instead of /tmp everywhere