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
[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

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

Before cancelling it :)

Change-Id: I2ba119b7e32cddc5255b52ae4d012ea223ea3b13
Don't check output if NULL
[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
[connect] don't set timeout handler to null after firing