Fix crash on GPOS kern classes select class text field

fontforgeexe/kernclass.c :: KCD_TextSelect() had several problems handling
text strings found in the "Select Class Containing:" incremental match
text field.  One could carefully tab into the field, but mouse clicking
into the field would instantly crash.

Code initially scanning string was missing check for end-of-string, which
was a problem when the field was empty.  Code was not checking the return
from u2utf8_copyn() which could return NULL on various errors.  The two
of these flaws caused the crash.

Additionally further on there was a duplicated check for end-of-string
and then a missing check that could walk off the end of the string.

Tested as fixed against both such text fields and with various input and
match strings.
Merge pull request #1678 from tshinnic/crash_kernclass_selectclass

Fix crash on GPOS kern classes select class text field