Use binmode for tempfile

CHEF-4795