ENH: remove insecure mktemp use

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