Fix tempfile binmode on windows 

Apparently the ':encoding => 'binary'' option does not change file to binmode, at least not on windows.

This changeset changes file to binary mode by calling binmode on the IO object.