(#3026) - fix race condition in leveldb