Switch to using tmpnam() from File::Temp

Switch to using tmpnam() from File::Temp which is far safer and works
better on MSWin32 platforms
Use File::Temp::mkstemp() to create temporary file

Use File::Temp::mkstemp() to create temporary file under Windows.

Note that Windows-specific tests will probably be made irrevelent in
the future