Add multi threaded functionality

This commit adds multi-threaded functionality within libcouchbase. It
works by running a specialized event loop in a dedicated thread, and
using locks to wait and submit operations to the library.

This commit also aims for _API_ compatibility with existing code, so
that newer APIs do not need to be used in order to cooperate with
multiple threads. These wrappers of course are a bit CPU intensive but
work quite well for simple code, or for the sake of porting an existing
lcb-wait based application over to the threaded code.

The wrapping is done partly via dedicated functions, and partly via a
Perl script which generates the proper stubs that can masquerade
themselves as normal API functions to the preprocessor.

WIP because of tests. Many more tests. And API sanity

Currently provided:

- I/O plugin for MT
- mt.h header file
- cbc-mtstress to test and stress the multi-threaded functionality

Change-Id: I783b74bf04f3b818d59610a18bea4435994012c6