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.
Further tests for RT #119089, inspired by some code from Dave Mitchell.
sharedsv_array_mg_free() and sharedsv_elem_mg_free() can be merged.

Dave Mitchell noticed that as the data points used by arrays elements to
track the shared aggregate are identical, than sharedsv_array_mg_free()
and sharedsv_elem_mg_free() are performing the same job, and can be merged.