Use our own mutex abstraction

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