Plug various leaks in tests

Change-Id: Ib10f6e747b3638c6cd96764ab86a94af1ac490a2
CCBC-213: Unify connection routines

The basic idea is to unify the structures for the connections used for
all our objects which depend on their own TCP connections. This is a
work in progress, though it does pass all unit tests without issue
(though integration tests are needed). Constructive comments
appreciated.

The history here was largely borrowed from another rewrite

Change-Id: Iffa9e7b0d8787ae42731f2716d9dc4e9f8f8a314
Abstract io notification requests

This basically wraps the update_event functions

Change-Id: I35f0b00ebf75e182cf4545a36f7b602ebf1b0cd2
Unify read/write functions and refactor them from parsers

- Now our parsing code is sectioned out from our I/O functions. Parsers
  work with a ringbuffer (or similar) structure, and the I/O functions
  are unified in the 'sockrw.c' file.

Change-Id: I3e0c87372dc308b99f6aa2de3c96284cbf6b42f1
Add ringbuffer_take_buffer

This is a convenience function to initialize a ringbuffer from an
already-allocated buffer.

Change-Id: I463388ee9867753a6e8b05ffbcebc6d00be5daa4
Make buffer structured owned by connection object

- These objects will be allocated pointers. This is needed for further
  changes, but also cleans things up a bit in terms of uniformity

Change-Id: I89c7a88669d8ab414adbbfe7c0acb7907a17b7d5
Implement simple want-read/want-write semantics

This changes the internal way the library communicates with its event
model. Rather than scheduling read/write requests on demand from random
places in code, code sets 'want' flags (which are the same as the
LCB_READ/LCB_WRITE_EVENT flags). The events are actually scheduled when
the top level 'stack' function (i.e. the event handler) itself leaves.

Not only is this more efficient (i.e. not calling update_event() all the
time, but calling something far more lightweight), but it also
centralizes event scheduling in a single location.

Change-Id: I31ad9183d026f55ae139f4845d040b27759e7c22
IOPS v1 plugin. Support for completion-oriented I/O (WIP)

Change-Id: I6f7a44058af2a179b45f26613400bb2a19f0a92d