Correctly check the length in of_string_check_utf8.