Fix bug caused when a Unicode character splits the buffer.

This fix handles the case where bytes of a Unicode character appear
at the end of a buffer and more bytes remain that make up the entire
Unicode character.