remove insecure mktemp usage

mktemp only returns a filename, a malicous user could replace it before
it gets used.