Add toggle-ref support
(Apply commit af75406 from 'mono_libgc' branch.)
GC backed toggleref machinery. This enables
an embedder to support toggleref style of external memory management
without hooking up to the host retain/release machinery.
The API export two entry points. The first let the caller register
a callback that decides the state of a given object, by
probably inspecting its native state. The second allows registration
of objects with the toggleref machinery.
The idea of toggleref is that we keep an external reference to an
object and it can be either a strong or weak reference. We use
a weak reference when the external peer has no interest into the
object and a strong otherwise.