patch 9.0.0980: the keyboard state response may end up in a shell command

Problem:    The keyboard state response may end up in a shell command.
Solution:   Only request the keyboard protocol state when the typeahead is
            empty, no more commands are following and not exiting.  Add the
            t_RK termcap entry for this.
diff --git a/src/proto/main.pro b/src/proto/main.pro
index f0f9b73..307b606 100644
--- a/src/proto/main.pro
+++ b/src/proto/main.pro
@@ -9,6 +9,7 @@
 void state_no_longer_safe(char *reason);
 int get_was_safe_state(void);
 void may_trigger_safestateagain(void);
+int work_pending(void);
 void main_loop(int cmdwin, int noexmode);
 void getout_preserve_modified(int exitval);
 void getout(int exitval);