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
 - Don't include the wide NULL character when calculating number of
   characters to write to the console to properly indent Puppets stdout
   output (without the -1 calculation, it's indented with two spaces).
 - Includes a test to ensure that we can detect when `string_encode` is
   updated in the future, when we move to a version of Ruby where the
   String#encode bug is fixed for encodings with multi-byte terminators

Paired-with Josh Cooper <josh@puppetlabs.com>