Fix GC for collectible classes (dotnet/coreclr#19892)
There is a subtle bug in the GC that causes access violation when a
LoaderAllocator of a collectible class is pushed to the mark stack and
that class also has partial sub-objects. One example is an array of byte
arrays. In that case, the mark stack is supposed to have the reference
to the instance of the class stored right before the related partial
sub-objects references. But due to the bug, the slot where the instance
of the class was expected to be located was not set to anything.
Commit migrated from https://github.com/dotnet/coreclr/commit/
cd1f0d9ad32cacd9d2ac2998f368bc196c40754a