Fixed error: 'O_BINARY' was not declared in this scope

as described in #461.