Specify binary mode for file reads and writes.

This might fix io on windows.