Work around a bug in perl < 5.13.10 with open($fh, ">:raw", \$string)

Perl versions 5.13.9 and earlier interact poorly with :raw and the
PerlIO layer which handles in-memory strings; this caused open($fh,
">:raw", \$string) to create a file on disk named "SCALAR(0xDEADBEEF)"
and "<:raw" to read a file on disk named similarly on such versions of
perl.

Change the two callsites which open in :raw mode on an in-memory string
to instead call binmode($fh, ":raw"), which works around this bug.