Convert notmuch_thread_ids_t to notmuch_terms_t