fixes for json.h detection and deprecated libcouchbase functions

fixes json-c header detection as discussed in pull #791 by using full paths and reworks small sections of code to eliminate deprecated functions in newer versions of libcouchbase (2.4.0+)