Fix for ticket #78

The change is that tempfiles are not placed in /tmp/ directly, but into a subdirectory of /tmp that is secure. This reduces the amount of security-relevant code to just the "mkdir -m 700...." command. mkdir complains if anything of that name already exists and does not follow symlinks, so we are safe against these types of attack.