MB-7267: Need to convert flg value to host byte order

On 1.8.x sqlite files, we save flg as network byte order. When convert
to couchstore file format, we need to convert flg from network byte order
to local host byte order.

Change-Id: Ic302000a10d32dc16934126b27c0a9fd7d1d2da0
Reviewed-on: http://review.couchbase.org/22833
Tested-by: Bin Cui <bin.cui@gmail.com>
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Tested-by: Steve Yen <steve.yen@gmail.com>
MB-7316: Check all 1.8.x sqlite files for vbucket_states table

That is, be sure to check the master sqlite file, not just the *.mb
shard files.

Also, the states field might be a writable buffer (instead of a
string), which Python can't use as a dict key.

Change-Id: I477176241f759cb943ea8a52594f640a20e1d84d
Reviewed-on: http://review.couchbase.org/23022
Tested-by: Bin Cui <bin.cui@gmail.com>
Reviewed-by: Bin Cui <bin.cui@gmail.com>
MB-7542: Set seq_id to 1 if not set or as zero

For offline upgrade or data restore, set seq_id to 1 when it is not set
or set as zero.

Change-Id: I5ff72068dfb07026e6cc528bf467055bcfe8b00f
Reviewed-on: http://review.couchbase.org/24003
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Tested-by: Bin Cui <bin.cui@gmail.com>
Reviewed-on: http://review.couchbase.org/24034
Merge branch 'branch_2.0.0'

* branch_2.0.0:
  MB-7542: Set seq_id to 1 if not set or as zero
  MB-7316: Check all 1.8.x sqlite files for vbucket_states table
  MB-7267: Need to convert flg value to host byte order

Change-Id: I5ff72068dfb07026e6cc528bf467055bcfe8b00f
Merge "Merge branch 'branch_2.0.0'"