Make getScopedLockAndFlush() in Category::refreshCounts non-blocking