optimize cgo leveldb

reduce memory copy, reduce cgo call number