patch 8.2.3640: freeze when calling term_wait() in a close callback

Problem:    Freeze when calling term_wait() in a close callback.
Solution:   Set a "closing" flag to tell term_wait() to return. (closes #9152)
diff --git a/src/proto/terminal.pro b/src/proto/terminal.pro
index 9304606..f5bd1a6 100644
--- a/src/proto/terminal.pro
+++ b/src/proto/terminal.pro
@@ -20,6 +20,7 @@
 void term_win_entered(void);
 int terminal_loop(int blocking);
 int may_close_term_popup(void);
+void term_channel_closing(channel_T *ch);
 void term_channel_closed(channel_T *ch);
 void term_check_channel_closed_recently(void);
 int term_do_update_window(win_T *wp);