memdb: fix data race