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>
[server]: Don't scan output buffer if NULL

Change-Id: I88226b3c25f4a44b57a5a8060d19e08639f46323
[iocp] various fixes

- Properly handle send_error:
    Set proper code and socket structure for its overlapped field

- Handle SO_UPDATE_CONNECT_CONTEXT failures:
    We sometimes get WSAENOTSOCK on this one

- Add WSAENOTSOCK to error list for w32err_2errno

- Fix socket leakage for each socket created (ouch!)

Change-Id: Ice2f451dad1e862fd6800df669b4af9b8c13a81b
[connect timers]: Check if timer was active

Before cancelling it :)

Change-Id: I2ba119b7e32cddc5255b52ae4d012ea223ea3b13
Don't check output if NULL

Change-Id: I774a906142f0668ac42f4b8246c562a8898064be
[bconf] Overhaul

This cleans up the bucketconfig code; breakouts and error propagation
are done from the I/O handlers rather than the parsing handlers. This
allows the I/O handlers to more easily cancel the timeouts if necessary.

Among the additions:

- New lcb_cntl operation for a configuration timeout (5 seconds by
  default)
- 'bconf_provider' module, where most of the bucket config updating is
  done
- Move stuff from bconf_parse over to bconf_io where it affects instance
  state and likewise.

Change-Id: I1a31d990b7333e1691855eb311bbec48b71b8a21
[http] Don't treat graceful close as an error

Now that we're sending Connection: close, it's perfectly fine (and in
fact, anticipated) that the server should close the connection when it's
ready. In this case, we need to consider it a success iff the parser has
finished too.

- Added LCB_SOCKRW_SHUTDOWN (technically, 0 means one of the two streams
  has been closed, so it's not technically a close in TCP parlance)

Change-Id: I126565c50cf3dbe9bc2ba79445bc8fd80e85962c
Always include lcbuv source code in dist

Change-Id: I449fa1a0548ebf67992db7feb695823f791cc7ab
declare all callbacks in one place

Change-Id: I3379cddfb7168fd2f050261d77da9e636a8d4992
[connect] don't set timeout handler to null after firing

Change-Id: Ie474b0d66cf8c9dcf921913a1c1ee476f21117fe
[test-failover]: make dummy timer for iocp

We can't just run the event loop as the IOCP plugin will complain about
a timeout not being set. Let's make a dummy lcb_timer_t so it won't
complain

Change-Id: Ic624c1c48552a537f1c0cef9d8663f62f737de1b