Make binwrite emulation work on Windows.
So, it turns out that Ruby on Windows is pretty damn awesome, and that to
successfully sysopen a file, then use it as an IO, you need to write this:
IO.new(IO::sysopen(filename, mode), mode) {|io| ... }
...yes, indeed, you need to repeat the mode, and pass the sysopen mode - which
is completely incompatible with the normal open. It works when you pass a
file descriptor from sysopen, though, and gets Ruby convinced to use it right.
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>