some fixes for win32, including ability to "make check" win32 builds via wine