patch 8.2.4237: record buffer wrong if character in Select mode was not typed

Problem:    Record buffer wrong if character in Select mode was not typed.
Solution:   Only delete the tail from the record buffer if the character was
            typed. (closes #9650)
diff --git a/src/normal.c b/src/normal.c
index e69c141..2184036 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1054,9 +1054,10 @@
 	// be mapped in Insert mode.  Required for ":lmap" to work.
 	len = ins_char_typebuf(vgetc_char, vgetc_mod_mask);
 
-	// When recording the character will be recorded again, remove the
-	// previously recording.
-	ungetchars(len);
+	// When recording and gotchars() was called the character will be
+	// recorded again, remove the previous recording.
+	if (KeyTyped)
+	    ungetchars(len);
 
 	if (restart_edit != 0)
 	    c = 'd';