KVRecordStore: make in-memory stats transactional