Use our own thread wrapper for tests

Change-Id: Id32ebcaa3ae2967cbc4c8fbdcb6ccff641ff2353
Reviewed-on: http://review.couchbase.org/31411
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>