chars: don't persist when only one of the compared sequences is invalid

Persisting might lead to count 'n' reaching zero, which would mean that
the needle has matched, which is wrong when one of the strings contains
an invalid or incomplete multibyte sequence.
1 file changed