lib: Fix notmuch_query_search_threads to return NULL on any Xapian exception.