Fix env.test when running mingw-w64 (AMD64 build) test-suite on wine64
Fix some gcc warnings which become visible with -Wextra
Fix env.test when running mingw-w64 (AMD64 build) test-suite on wine64. 
Fix some gcc warnings which become visible with -Wextra