Fix segment map modification in OOM scenarios (dotnet/coreclr#9241)
* Fix an issue where the segment mapping table is not reverted
back to its original state when failing to commit the mark array
in an OOM scenario. Fixes dotnet/coreclr#9064
* Code review feedback
* Update seg_mapping_table before setting g_gc_*_address
* Add a barrier between the seg_mapping_table write and updates to g_gc_*_address
Commit migrated from https://github.com/dotnet/coreclr/commit/
5a7dc18f5985bd28ea798e6a9fc4b8ad5fef09ca