Add NULL check on finalizing tokenizer

Tokenizer may be NULL when normalizer returns an error such as
unsupported encoding.