Harden test against JIT optimizations
Declare static field `finalizerCompletedOnce` volatile -- this test has a
side-effect-free busy-loop which checks that static variable for a change it
expects a finalizer to make to it; this static field must be volatile to
ensure the jit doesn't hoist the load from the loop.
Call GC.KeepAlive on the objects constructed in the various allocation
loops in this test, to make sure that the entire allocation isn't
optimized away.
Commit migrated from https://github.com/dotnet/coreclr/commit/
f6b070c69585761996778fa5228b07d0be26be57