patch 8.0.1525: using :wqa exits even if a job runs in a terminal window

Problem:    Using :wqa exits even if a job runs in a terminal window. (Jason
            Felice)
Solution:   Check if a terminal has a running job. (closes #2654)
diff --git a/src/buffer.c b/src/buffer.c
index c3e0c50..a3a7e00 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1875,10 +1875,10 @@
 }
 
     void
-no_write_message_nobang(void)
+no_write_message_nobang(buf_T *buf UNUSED)
 {
 #ifdef FEAT_TERMINAL
-    if (term_job_running(curbuf->b_term))
+    if (term_job_running(buf->b_term))
 	EMSG(_("E948: Job still running"));
     else
 #endif