Reduce lock-protected area during scrape.

Change-Id: Iaa7faa7c916b1890b568d05bd8bfff6299b6767d