Use our thread abstraction layer

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