threads::shared should not crash if shared elements outlive their aggregate.

If an element of a shared aggregate is returned from a function, it is
possible for it to outlive the aggregate itself. As the element has a pointer
to the underlying shared aggregate and might use it, it is necessary for that
pointer to remain valid. Hence threads::shared needs to ensure that cleanup
of the shared aggregate is performed by the last proxy pointing to it, which
is not necessarily the proxy for the aggregate itself. This can happen with
lvalue subroutines.

See the discussion in perl #119089 for more details.

XXX This can't be the final version of this fix, because it fails an
assertion on earlier perls.