Added a second constructor for ThreadedFile taking an already opened FD.
Using mkstemps() on Posix to generate a temporary file handle instead of tmpnam(). Fixes issue #137.

This is checked in from a Windows box, so still needs actual testing.