[13.x] Fix `distinct:ignore_case` throwing on values that are not valid UTF-8
When distinct:ignore_case validates a string that isn't valid UTF-8, for example a request like ?tags[]=caf%E9 against 'tags.*' => 'distinct:ignore_case', the validator throws ErrorException: preg_grep(): Compilation failed: UTF-8 error and the request ends in a 500 instead of a validation response.
The value is passed through preg_quote() into a pattern with the u modifier, and PCRE refuses to compile a pattern with invalid UTF-8 in it. Without an error handler turning the warning into an exception, preg_grep() returns false instead, and two identical values then pass the rule.
This adds an mb_check_encoding() check next to the is_string() check from #60961, so these values fall through to the exact in_array() comparison that's already used without ignore_case. Valid UTF-8 input behaves the same as before, and two identical invalid values are still reported as duplicates.