Mb-11519: Check mode value

Stop if mode value is not valid or supported.

Change-Id: I4c217a7164b1bd1c0d30c339c5d6cdc70814f3ad
Reviewed-on: http://review.couchbase.org/38720
Tested-by: Bin Cui <bin.cui@gmail.com>
Reviewed-by: Steve Yen <steve.yen@gmail.com>