(PUP-1840) Use binary mode for files

Understanding the checksums for files requires that we are very careful
about how data is written and read. This is to avoid having a windows
system translate line endings and causing the data on disk to be
different from what the tests expect.
Merge pull request #2598 from zaphod42/issue/master/pup-1840-use-binread-on-windows

(PUP-1840) Use binary mode for files