Add libcouchbase_debug.so

This is a library where we may put extra debug
stuff the user might want to use.

Change-Id: Ib5511c1caae713b286b9373fe679826e762f9080
Reviewed-on: http://review.couchbase.org/23939
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Fix buildbreak for missing error code from cstdlib

Change-Id: I6b15a0d0169161f24a81a571ceb6dabfacc87eb2
Reviewed-on: http://review.couchbase.org/23983
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Always copy packet to local buffer during parse

It allows to purge the server buffers from within user callback.
Further commits will allow to call lcb_connect() from the callbacks
when user would like to re-initialize lcb_t handle without destroying
it.

Change-Id: Ie786d86a9cf55dff26a3375940e62503a99ec9b3
Do not read request twice

Change-Id: Ia68c148fe825c392b46b0dbe646ee35430661e87
Use more clear name for packet buffer

Change-Id: Ifdbc27c89d6efe95fa97837001b3af6fe89bfc07
always peek request from cmd_log and pass to handler

* simplifies key extraction
* helps to purge buffers properly if lcb_connect called from the
  callback

Change-Id: I094e2888d9973fce83a4620fec34efd629b58794
Purge pending operation on reconnecting

Change-Id: I925c9483f0ed4f692530c7330453dfce381b2de4