patch 8.1.0087: v:shell_error is always zero when using terminal for "!cmd"

Problem:    v:shell_error is always zero when using terminal for "!cmd".
Solution:   Use "exitval" of terminal-job. (Ozaki Kiichi, closes #2994)
diff --git a/src/terminal.c b/src/terminal.c
index a67c87a..6195ad5 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -5336,6 +5336,12 @@
 	}
 }
 
+    job_T *
+term_getjob(term_T *term)
+{
+    return term != NULL ? term->tl_job : NULL;
+}
+
 # if defined(WIN3264) || defined(PROTO)
 
 /**************************************