MB-12028: correctly handle missing master vbucket

The bug was due to setting ChainStates element to missing instead of
pair {N, missing}.

I've also added more logging and make sure that we assert that at
least head of ChainStates is a pair. Tests are added for cover all
paths through do_sanify_chain.

Change-Id: I8a433a88d7fc7ba4a3ef96c30db56d3a15d6cf5e
Reviewed-on: http://review.couchbase.org/40732
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>