simpler handling of RVs

This removes all the complicated work-around for reblessing. Also, a test to make sure we never break serialising refs to readonly values.
I've tested on 5.18.1 and 5.8.9
I sent a similar patch to JSON::XS, but it was refused.