When sorting items for persistence sort similar key by highest seqno

This allows us to deduplicate similar keys and keep the one with the
highest sequence number.

Change-Id: I4b127dcebb64c904ad18e06348b991a9cd76bfab
Reviewed-on: http://review.couchbase.org/33461
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>