Conditionally pause GC in the pause_gc method