MB-11488 Set the thread local to NULL before logging.

Any memory allocations within logging function, which can be
freed later, should not be accounted in a bucket memory usage.

Change-Id: I0a2e5b5a041e77e25708d57fa29ddfd4accb79c5
Reviewed-on: http://review.couchbase.org/38941
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>