list func uses threadDictionary to store references to JS callbacks evsukov89/couchbase-lite-ios#6