Add GC critical section to GetObjectsAllocated

Prevent GC running during GetObjectsAllocated since we may get a
checkpoint request that tells us to suspend while we are doing
SuspendAll. This can cause a deadlock.

Bug: 35232978

Test: test-art-host

Change-Id: I9c02415df0a0b9fa787d7ce449ec06a40dfaf624
4 files changed