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/screen.c b/src/screen.c
index 447eb1e..7d62042 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1200,11 +1200,10 @@
 #endif
 
 #ifdef FEAT_TERMINAL
-    if (wp->w_buffer->b_term != NULL)
+    /* If this window contains a terminal, redraw works completely differently.
+     */
+    if (term_update_window(wp) == OK)
     {
-	/* This window contains a terminal, redraw works completely
-	 * differently. */
-	term_update_window(wp);
 	wp->w_redr_type = 0;
 	return;
     }
@@ -6849,14 +6848,14 @@
 	p = NameBuff;
 	len = (int)STRLEN(p);
 
-	if (wp->w_buffer->b_help
+	if (bt_help(wp->w_buffer)
 #ifdef FEAT_QUICKFIX
 		|| wp->w_p_pvw
 #endif
 		|| bufIsChanged(wp->w_buffer)
 		|| wp->w_buffer->b_p_ro)
 	    *(p + len++) = ' ';
-	if (wp->w_buffer->b_help)
+	if (bt_help(wp->w_buffer))
 	{
 	    STRCPY(p + len, _("[Help]"));
 	    len += (int)STRLEN(p + len);