MB-12644:bp:MB-12238: set timeout of 10 minutes on xmem requests

As another measure against possible issues when NAT between DCs
forgets about our connections. With this patch, if this happens, xdcr
will still get stuck, but it won't last too long due to timeout. When
timeout hits, affected xdcr replicators will crash and be restarted
have a decent chance of working.

Orig-Reviewed-on: http://review.couchbase.org/41588

Conflicts:
	src/pooled_memcached_client.erl
	src/xdc_vbucket_rep_xmem.erl

Change-Id: I3c8a96d71bcb983be5e804c3e6e8eaaf7be4e7b4
Reviewed-on: http://review.couchbase.org/43231
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-12644:bp:MB-12238: set SO_KEEPALIVE on xmem and ssl proxy sockets

As another guard against possible issues when NAT forgets about
connections between datacenters.

bp note: While I don't think it'll actually affect MB-12238 at all
given that keepalive doesn't work for non-idle sockets and idle
sockets are not kept long by connections pool, I don't want to cause
additional discussion with folks who monitor backports.

Orig-Reviewed-on: http://review.couchbase.org/41589

Conflicts:
	src/memcached_clients_pool.erl

Change-Id: Ica2f6e03b4929b730ba98a4b8621e321870d025d
Reviewed-on: http://review.couchbase.org/43232
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Merge branch '2.5.1.1' into rel-3.0.0++

* 2.5.1.1:
  MB-12644:bp:MB-12238: set SO_KEEPALIVE on xmem and ssl proxy sockets
  MB-12644:bp:MB-12238: set timeout of 10 minutes on xmem requests

Conflicts:
	src/memcached_clients_pool.erl
	src/pooled_memcached_client.erl
	src/xdc_vbucket_rep_xmem.erl

This merges backport of MB-12238 into 2.5.1.1. Approval for 2.5.1.1
made MB-12238 automatically approved for 3.0.2.

Change-Id: I59a3199bec546963538a626997a7ec59115bd719