Retry on connection failure

Change-Id: I125eb36cdff4ac3d19da2b80126463f7408f7a85
Reviewed-on: http://review.couchbase.org/28261
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>