patch 8.0.0884: can't specify the wait time for term_wait()

Problem:    Can't specify the wait time for term_wait().
Solution:   Add an otional second argument.
diff --git a/src/evalfunc.c b/src/evalfunc.c
index fde2058..2377d19 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -843,7 +843,7 @@
     {"term_scrape",	2, 2, f_term_scrape},
     {"term_sendkeys",	2, 2, f_term_sendkeys},
     {"term_start",	1, 2, f_term_start},
-    {"term_wait",	1, 1, f_term_wait},
+    {"term_wait",	1, 2, f_term_wait},
 #endif
     {"test_alloc_fail",	3, 3, f_test_alloc_fail},
     {"test_autochdir",	0, 0, f_test_autochdir},
diff --git a/src/terminal.c b/src/terminal.c
index d300b1f..0f70cc6 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -36,7 +36,6 @@
  * that buffer, attributes come from the scrollback buffer tl_scrollback.
  *
  * TODO:
- * - Add argument to term_wait() for waiting time.
  * - For the scrollback buffer store lines in the buffer, only attributes in
  *   tl_scrollback.
  * - When the job ends:
@@ -2248,12 +2247,15 @@
     }
     else
     {
+	long wait = 10L;
+
 	mch_check_messages();
 	parse_queued_messages();
 
-	/* Wait for 10 msec for any channel I/O. */
-	/* TODO: use delay from optional argument */
-	ui_delay(10L, TRUE);
+	/* Wait for some time for any channel I/O. */
+	if (argvars[1].v_type != VAR_UNKNOWN)
+	    wait = get_tv_number(&argvars[1]);
+	ui_delay(wait, TRUE);
 	mch_check_messages();
 
 	/* Flushing messages on channels is hopefully sufficient.
diff --git a/src/version.c b/src/version.c
index e6bcfb5..e318114 100644
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    884,
+/**/
     883,
 /**/
     882,