Fixed random memory issues as the libcouchbase object was not getting destroyed properly