MB-12328: Build 3.0 + MB-12328 backport

Change-Id: I1bbd3e709493b5bca85edf3b6c0921c6d90d6d6c
Reviewed-on: http://review.couchbase.org/42398
Reviewed-by: Chris Hillery <ceej@couchbase.com>
Tested-by: Chris Hillery <ceej@couchbase.com>