Ensure binary modes are used in tests, for Windows