PUP-1494 Guard against Win32 memory corruption

 - Ruby's .encode(UTF-16LE) call on String may generate a string that
   not properly terminated with 2 NULLs, which may result in garbage
   bytes read from the memory pointer passed into the Win32 API. This
   can cause memory instability which results in failures in later
   Win32 calls.  These calls have been replaced with an internal
   helper that properly NULl terminates the string.  Note that this
   bug is fixed in Ruby 2.1:
   http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=41920&view=revision