Use g_lstat instead of lstat for portability
Use file modes supported by mingw compiler on Windows
Also define casting macro when using mingw compiler
Work around badly chosen argument name in giomm
Fix ambiguous type CheckMenuItem that is also defined via windows.h
Use jack_client_stop_thread on windows
Allow PBD::canonical_path to compile with mingw build
Add PBD::ffs function
Use PBD::ffs for portability