Open files in binary mode to disable text translation

To ensure the correct handling of binary files under Windows, all file
opens now force binary mode.
Updated to use file_open macros, reducing original code changes

Use of the O_BINARY flag still depends on whether it's available,
rather than a build environment or platform check.
Changed file_open to use GCC variadic macro

Also changes the conditional use of O_BINARY to the MINGW32 build system.
Merge pull request #24 from simonowen/binary

Open files in binary mode to disable text translation