Simplify the fix for bug #41530
We don’t need to upgrade the target string and redo the pattern match
if the replacement is in utf8. We can simply convert during concate-
nation, using the more recently added SV_CATUTF8 and SV_CATBYTES flags
to sv_catpvn_flags.
This should make things faster, too, as sv_catpvn_flags does not need
to allocate extra SVs or string buffers.
This happened to trigger an existing COW bug, causing test failures.
SvIsCOW and sv_force_normal_flags were being called on TARG before
get-magic. So a magical scalar returning a COW could have that COW
modified in place.
I added a test for something I nearly broke.