Do not hold the lock more than is necessary in FileDB.