fix tempfile handling, use class Tempfile

Use Tempfile for automated random file names under /tmp and cleanup.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>