PYCBC-490: Use C to interpolate logging input
PYCBC-490: Use C to interpolate logging input

Motivation
----------
On some older Python 2.7 systems on Linux, the PyUnicode_FromFormatV
function was mishandling some printf interpolation arguments,
in this case "%.*s", a string with a given length.
PyUnicode_FromFormatV should actually just dump the remainder of
the format string but in some cases it segfaults instead when it
encounters something it doesn't understand.

In addition, we want to be able to log output from these more unusual
interpolation strings, so it seems better to use a C function to write
to a buffer before sending it to CPython for logging.

Changes
-------
Added a fixed size buffer (currently 1000 characters) to log
input from, and write into it using vsnprintf. Then
convert into a Python string and pass it into the Python
logging function.

Results
-------
Input is correctly interpolated and any Python segfaults are
prevented.

Change-Id: I9504b03728e3e9c706cf80d1bdc55d162f5f0c4a
Reviewed-on: http://review.couchbase.org/94518
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Ellis Breen <9d8041ac7ead8d3e1f3217c04c7ed5e3098c2381@couchbase.com>

couchbase/couchbase-python-client,couchbase/couchbase-python-client