tests: started to fix Windows compatibility problems
Merge branch 'master' into tests/win32_compat
Unit tests all successfully run with MSVC builds