Fix Windows line-ending issues

On Windows, any newlines printed to $stdout are automatically converted
to "\r\n", which breaks the protocol buffer format.  Switching $stdout to
binary mode immediately before printing the file prevents this from
happening.
Merge pull request #31 from dpwright/windows-newlines

Fix Windows line-ending issues