Fix race condition in fragment cache.