patch 8.1.1575: callbacks may be garbage collected

Problem:    Callbacks may be garbage collected.
Solution:   Set reference in callbacks. (Ozaki Kiichi, closes #4564)
diff --git a/src/terminal.c b/src/terminal.c
index 21026e2..3511e0c 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -4051,7 +4051,7 @@
     term_T	*term;
     typval_T	tv;
 
-    for (term = first_term; term != NULL; term = term->tl_next)
+    for (term = first_term; !abort && term != NULL; term = term->tl_next)
 	if (term->tl_job != NULL)
 	{
 	    tv.v_type = VAR_JOB;