fix tempfile handling, use class Tempfile

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