patch 8.2.4299: SafeState autocommand interferes with debugging

Problem:    SafeState autocommand interferes with debugging.
Solution:   Do not trigger SafeState while debugging. (closes #9697)
diff --git a/src/main.c b/src/main.c
index fa5d8f1..389d570 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1047,7 +1047,8 @@
     return stuff_empty()
 	&& typebuf.tb_len == 0
 	&& scriptin[curscript] == NULL
-	&& !global_busy;
+	&& !global_busy
+	&& !debug_mode;
 }
 
 /*