Stop pos from panicking when overloading changes UTF8ness
This touches on issues raised in tickets #114410 and #114690.
If the UTF8ness of an overloaded string changes with each call, it
will make magic_setpos panic if it tries to stringify the SV multiple
times. We have to avoid any sv-specific utf8 length functions when
it comes to overloading. And we should do the same thing for gmagic,
too, to avoid creating caches that will shortly be invalidated.
The test class is very closely based on code written by Nicholas Clark
in a response to #114410.