Fix for insecure use of tempfile.mktemp

fixes CVE-2014-1932 CVE-2014-1933, Debian bug #737059: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737059