Set stdout to binary mode on Windows as needed