[runtime] Unbalanced GC Unsafe transitions before shutdown (mono/mono#17566)
When embedders call mono_runtime_quit or mono_jit_cleanup, we need to do unbalanced transitions to GC Unsafe, because after mini_cleanup runs we don't have GC thread states anymore and MONO_EXIT_GC_UNSAFE will assert.
* [runtime] Do an unbalanced GC Unsafe transition in mono_jit_cleanup
After mini_cleanup, we don't have GC thread states anymore because all that
stuff was cleaned up, so MONO_EXIT_GC_UNSAFE would assert
* [runtime] Mark mono_runtime_quit external only.
Runtime should use mono_runtime_quit_internal.
After we call the quit_function (aka mini_cleanup) we don't have any GC thread
states anymore because all that stuff got cleaned up. So MONO_EXIT_GC_UNSAFE
can't work.
Commit migrated from https://github.com/mono/mono/commit/
0e3caf00df54199be88cfcb53ed847226defebb4