patch 8.0.0797: finished job in terminal window is not handled

Problem:    Finished job in terminal window is not handled.
Solution:   Add the scrollback buffer.  Use it to fill the buffer when the job
            has ended.
diff --git a/src/channel.c b/src/channel.c
index 9885dfe..073694e 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -2921,6 +2921,10 @@
     }
 
     channel->ch_nb_close_cb = NULL;
+
+#ifdef FEAT_TERMINAL
+    term_channel_closed(channel);
+#endif
 }
 
 /*
@@ -4696,10 +4700,6 @@
 	 * not use "job" after this! */
 	job_free(job);
     }
-
-#ifdef FEAT_TERMINAL
-    term_job_ended(job);
-#endif
 }
 
 /*