Adding O_BINARY to open flags for compatibility with windows.