Don’t cache qr magic on references

When a scalar is returned from (??{...}) inside a regexp, it gets com-
piled into a regexp if it is not one already.  Then the regexp is sup-
posed to be cached on that scalar (in magic), so that the same scalar
returned again will not require another compilation.

This has never worked correctly with references, because the value was
being cached against the returned scalar itself, whereas the *refer-
ent* of a returned reference was being checked for qr magic.

Commit 636209429 (recent) attempted to fix the resulting bug, but
ended up exposing another, older bug, that e4bfbed39b (5.18) acciden-
tally (?) fixed.  The stringification of a reference can easily change
without the reference itself being touched.  So set-magic (which
clears the qr cache) is never triggered:

{ package o; use overload '""'=>sub{"abc"} }
$x = bless \$y, "o";
sub foo { warn "abc" =~ /(??{$x})/ }
foo();
bless \$y;
warn "$x";
foo();
__END__

Output:
1 at - line 3.
main=SCALAR(0x7fcbc3027478) at - line 6.
1 at - line 3.

Blessing \$y into main causes it to stringify as
main=SCALAR(0x7fcbc3027478).  So how can "abc" match
/main=SCALAR(0x7fcbc3027478)/?

Skipping the cache for references obviously fixes this.  The cache was
only being stored on refs to overloaded objects, which don’t use the
cache.  The only case in which is was being used was when the over-
loaded object was blessed into a non-overloaded class, and then it
was incorrect.
Reënable qr caching for (??{}) retval where possible

When a scalar is returned from (??{...}) inside a regexp, it gets com-
piled into a regexp if it is not one already.  Then the regexp is sup-
posed to be cached on that scalar (in magic), so that the same scalar
returned again will not require another compilation.

Commit e4bfbed39b disabled caching except on references to overloaded
objects.  But in that one case the caching caused erroneous behaviour,
which was just fixed by 636209429f and this commit’s parent, effect-
ively disabling the cache altogether.

The cache is disabled because it does not apply to TEMP variables
(those about to be freed anyway, for which caching would be a waste
of CPU), and all non-overloaded non-qr thingies get copied into
new mortal (TEMP) scalars (as of e4bfbed39b) before reaching the
caching code.

This commit skips the copy if the return value is already a non-magi-
cal string or number.  It also allows the caching to happen on con-
stants, which has never been permitted before.  (There is actually no
reason for disallowing qr magic on read-only variables.)
Test that (??{$pvlvregexp}) does not recompile the regexp

2685dc2d9a accidentally fixed this.  Oops! :-)