leveldb: Fixed bugs in some iterator implementation