Fixes T5316. PCRE can blow stacks on (x|y)+ regexps, and a user is hitting a consistent fatal in PCRE.
Rewrite the fallback for phutil_is_utf8() to be iterative. This is somewhat slower, but not normally too horrible, and we have a variety of ways to mitigate that if it arises as a real issue (encourage installation of mb extension, ship a fast C extension, etc).
We already have most of this code anyway.