patch 8.2.5023: substitute overwrites allocated buffer

Problem:    Substitute overwrites allocated buffer.
Solution:   Disallow undo when in a substitute command.
diff --git a/src/undo.c b/src/undo.c
index cac09f0..81cc28e 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -2327,6 +2327,12 @@
     int		    above = FALSE;
     int		    did_undo = TRUE;
 
+    if (text_locked())
+    {
+	text_locked_msg();
+	return;
+    }
+
     // First make sure the current undoable change is synced.
     if (curbuf->b_u_synced == FALSE)
 	u_sync(TRUE);