fixed windows compile (conditionally include fcntl etc for __O_BINARY)