patch 8.0.1641: job in terminal can't communicate with Vim

Problem:    Job in terminal can't communicate with Vim.
Solution:   Add the terminal API.
diff --git a/src/buffer.c b/src/buffer.c
index c7f361a..7bd3cdf 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -948,7 +948,7 @@
     }
 }
 
-#if defined(FEAT_LISTCMDS) || defined(PROTO)
+#if defined(FEAT_LISTCMDS) || defined(FEAT_TERMINAL) || defined(PROTO)
 /*
  * Go to another buffer.  Handles the result of the ATTENTION dialog.
  */