Skip thread-safety check when running on dispatch queues.

Fixes couchbase/couchbase-lite-ios#376