lib: make notmuch_threads_valid return FALSE when passed NULL