When we request an auxilary thread to shutdown, maybe another thread is
still waiting to do GC. Therefore we need to guard here so we don't
deadlock when somebody requested a GC but we're also shutting down.
Related to #1952
When a thread was cleaned up, it could be that the VM lock object was
still locked in VM::wakeup. We now lock around the discard code to grab
This means we have to change the code that releases contention, since if
it's called when the VM lock is still taken, it might deadlock.