Fix locking in GC.rootIter and GC.rangeIter