Fix binary mode stdio on Windows