Make sure only one leveldb batch is running at the time