Use binary fopen on MinGW otherwise it does CRLF => LF by itself.