patch 8.1.2134: modifier keys are not always recognized

Problem:    Modifier keys are not always recognized.
Solution:   Handle key codes generated by xterm with modifyOtherKeys set.
            Add this to libvterm so we can debug it.
diff --git a/src/getchar.c b/src/getchar.c
index 85cedde..ecd6bdc 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -1733,6 +1733,25 @@
 		case K_XRIGHT:	c = K_RIGHT; break;
 	    }
 
+	    if (!no_reduce_keys)
+	    {
+		// A modifier was not used for a mapping, apply it to ASCII
+		// keys.
+		if ((mod_mask & MOD_MASK_CTRL)
+			&& ((c >= '`' && c <= 0x7f)
+			    || (c >= '@' && c <= '_')))
+		{
+		    c &= 0x1f;
+		    mod_mask &= ~MOD_MASK_CTRL;
+		}
+		if ((mod_mask & (MOD_MASK_META | MOD_MASK_ALT))
+			&& c >= 0 && c <= 127)
+		{
+		    c += 0x80;
+		    mod_mask &= ~MOD_MASK_META;
+		}
+	    }
+
 	    // For a multi-byte character get all the bytes and return the
 	    // converted character.
 	    // Note: This will loop until enough bytes are received!