Fix segment closing and offset calculation.
Fix segment closing and offset calculation.

wwezhuimeng/riak_search,xuejianhai/riak_search,basho/riak_search,basho/riak_search,xuejianhai/riak_search,wwezhuimeng/riak_search