MB-11916 Synchronize the access to thread job logs.

Change-Id: I9551cd70b931b1ed92f806be1df0325d922a239c
Reviewed-on: http://review.couchbase.org/40637
Reviewed-by: abhinav dangeti <abhinav@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung@couchbase.com>