Made KanjiGuesser more resistant to resource leaks.