MB-8846 Use std::set instead of unordered::set.

The current mingw build env doesn't support unordered::set.

Change-Id: Ib4c6e635015ff464442430e138169d1fb067b063
Reviewed-on: http://review.couchbase.org/28257
Tested-by: Bin Cui <bin.cui@gmail.com>
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
MB-8828: Check memory condition before returning enomem for withmeta ops

If we run into a memory condition when we are trying to put something
into the hashtable then we return enomem even though we might actually
be able to free memory. This change makes sure we check the memory
condition before actually returning an error code.

Change-Id: I3d10641764653c971aaeb9e8089fb21fe891a699
Reviewed-on: http://review.couchbase.org/28269
Reviewed-by: David Liao <david.liao@couchbase.com>
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-8825: Add stat to keep track of conflict resolution fails

This stat will help with xdcr debugging

Change-Id: Ie2ea77f51f40581ab60c823cf40c5276b4e27845
Reviewed-on: http://review.couchbase.org/28271
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
MB-8861: Release bucket lock before queueing a dirty item

When we queue a dirty item we notify any tap connections that
are streaming items from the vbucket the item was added to. If we
don't release the lock then we can cause a deadlock on the
notifySync and queueLock variables in the tap replicator.

Change-Id: Ia8fc31f5c0ac33cf6a79ef4dd4337f8a6459d6ef
Reviewed-on: http://review.couchbase.org/28319
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Merge branch '2.1.1'

Conflicts:
	src/bgfetcher.h
	src/common.h
	src/ep.cc

Change-Id: I872c4f4152c70738f6eb14548cff09790229e448