While a number of errors can happen when iterating over threads
(DatabaseModifiedError, memory allocation errors, etc.), the API
currently cannot signal them to the caller, and either triggers an
internal error (aborting the caller) or returns NULL from
notmuch_threads_get() with no information on what actually went wrong.
Add a new public function notmuch_threads_status() - similar to
previously added notmuch_messages_status() - that allows propagating
those errors to the caller.
Use this to remove the INTERNAL_ERROR() in _notmuch_thread_create()
(triggered by T642).
Fixes: https://github.com/pazz/alot/issues/1460 Amended-By: db. Resolved whitespace disagreement between emacs and
uncrustify in favour of uncrustify.