Switch from using POSIX::tmpnam to File::Temp

Switch from using POSIX::tmpnam to File::Temp as File::Temp is more
Windows-friendly and has a better reputation for safety.