Create temporary file with name as suffix

This helps editors guess the filetype to properly set up their syntax
highlighting.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Use TMPDIR for temporary files

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>