Reset the server's buffers upon reconnection

This fixes a crash experienced when requesting a new read with the
previous buffer still in tact.

This was exposed by calling lcb_failout_server on a timeout error while
maintaining the same server struct. This path is only followed for
failed negotiations but is the only time in code where we re-create the
socket.

Change-Id: Iedaed57ddf689189cc597eea29165d861ed14c97
Reviewed-on: http://review.couchbase.org/29681
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
CCBC-275: Do a full purge when negotiation times out

In this case we must purge the server from all commands and not simply
pop individual items. This is because we get odd behavior otherwise.

Added is a test developed with sweat and blood that reproduces the old
behavior where the client would crash.

Change-Id: Ib2c3724fde22d60388e0985a109aed8d66da9a51
Reviewed-on: http://review.couchbase.org/29671
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
CCBC-243 Substitute isasl with cbsasl

cbsasl has implemented both PLAIN and CRAM-MD5 authentication
mechanisms

Change-Id: I7fcb19a59951a65f363bc66bd0375c67c2a0d468
Reviewed-on: http://review.couchbase.org/29627
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
CCBC-243 Handle SASL STEP and LIST_MECHS commands

CRAM-MD5 mechanism requires handlers for PROTOCOL_BINARY_CMD_SASL_STEP
and PROTOCOL_BINARY_CMD_SASL_LIST_MECHS

Change-Id: I117d751cff2b5ddf09f9a08d82b868a7b91e785a
Reviewed-on: http://review.couchbase.org/29628
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>