Fix win32 unicode paths

This patch series makes file paths Unicode-safe.  On Mac and Linux this hasn't been a problem since UTF-8 paths can be used.  On Windows the local 8-bit encoding is used for fopen() and other functions.

Replace Windows API functions with Qt functions that automatically handle Unicode QStrings.  Also replace fopen() with the Windows wide-character _wfopen().

These patches fix failure to create and open files on Windows hosts where Unicode paths are used (for example, if the Windows username is non-ASCII).  The log file and temporary files were failing since the local 8-bit fopen() was being used.