### Godot version

Latest 4.0.dev (a3a42159e31db27f8ae7c1ecad6a9ed417cb05de)

### System information

Ubuntu 22.04.1 LTS

### Issue description

Ctrl+Shift+F (Find in Files) in the text editor, for example, causes my laptop to freeze consistently. I also reproduced it with F1 and Ctrl+Shift+R, as well as by using the dropdown instead of shortcuts.

### Steps to reproduce

Trivial

### Minimal reproduction project

N/A
KeySym keysym_keycode = 0; 
	KeySym keysym_unicode = 0; 
	
	char str[256] = {};
	XKeyEvent xkeyevent_no_mod = *xkeyevent;
	xkeyevent_no_mod.state &= ~ShiftMask;
	xkeyevent_no_mod.state &= ~ControlMask;
	XLookupString(xkeyevent, str, 255, &keysym_unicode, nullptr);
	String keysym;
	if (xkb_keysym_to_utf32 && xkb_keysym_to_upper) {
		KeySym keysym_unicode_nm = 0; 
		XLookupString(&xkeyevent_no_mod, nullptr, 0, &keysym_unicode_nm, nullptr);
		keysym = String::chr(xkb_keysym_to_utf32(xkb_keysym_to_upper(keysym_unicode_nm)));
	}
	
	if (!xmbstring) {
		
		xmbstring = (char *)memalloc(sizeof(char) * 8);
		xmblen = 8;