Glib fails if the NULL-terminator is included when a length is
specified.
I recently pushed "Allow using Glib for UTF8 support" after doing
excessive negative testing. However, I forgot to do positive testing and
therefore failed to discover that Glib treats a NULL-terminator as an
error in validation.
This patch changes our consumers to drop the NULL-terminator before
passing it to validation. This works properly on both Glib and
libunistring.