fix leveldb cursor implementation