tests: Fix a number of tests so they pass on Windows.
This is a continuation to !406 (merged). With this MR all the tests pass on Windows. The next step is to allow the CI to run crosstests on Windows.
This is a continuation to !406 (merged). With this MR all the tests pass on Windows. The next step is to allow the CI to run crosstests on Windows.