(PUP-1494) Don't write the embedded NULL to the console

The previous commit ensures that the wide string contains a double NULL
terminator, but it was including the wide NULL character when calculating the
number of characters to write to the console. As a result, all of the puppet
stdout was indented with two spaces.

This commit excludes the wide NULL character when calculating the number of
characters to write to the console. It also adds 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.