patch 8.1.2075: get many log messages when waiting for a typed character

Problem:    Get many log messages when waiting for a typed character.
Solution:   Do not repeat the repeated messages when nothing happens.
diff --git a/src/main.c b/src/main.c
index c18fc6f..33ac89c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1122,7 +1122,16 @@
     if (was_safe)
     {
 #ifdef FEAT_JOB_CHANNEL
-	ch_log(NULL, "SafeState: back to waiting, triggering SafeStateAgain");
+	// Only do this message when another message was given, otherwise we
+	// get lots of them.
+	if ((did_repeated_msg & REPEATED_MSG_SAFESTATE) == 0)
+	{
+	    int did = did_repeated_msg;
+
+	    ch_log(NULL,
+		      "SafeState: back to waiting, triggering SafeStateAgain");
+	    did_repeated_msg = did | REPEATED_MSG_SAFESTATE;
+	}
 #endif
 	apply_autocmds(EVENT_SAFESTATEAGAIN, NULL, NULL, FALSE, curbuf);
     }