### Godot version

2992ffd25523cb8b3e0ef1b873c40115b8940178

### System information

Windows 10

### Issue description

Godot crashes randomly within a few seconds after project start when moving with the mouse.

![win_err](https://github.com/godotengine/godot/assets/52464204/1da28596-d95b-40f3-b32f-12219ec02c5d)

Started after recent merge of https://github.com/godotengine/godot/pull/67791.
I can confirm that reverting the pr fixes the crashes.

### Steps to reproduce

see desc

### Minimal reproduction project

N/A
KeyMappingX11::initialize();
#ifdef SOWRAP_ENABLED
#ifdef DEBUG_ENABLED
	int dylibloader_verbose = 1;
#else
	int dylibloader_verbose = 0;
#endif
	if (initialize_xlib(dylibloader_verbose) != 0) {
		r_error = ERR_UNAVAILABLE;
		ERR_FAIL_MSG("Can't load Xlib dynamically.");
	}
	if (initialize_xcursor(dylibloader_verbose) != 0) {
		r_error = ERR_UNAVAILABLE;
		ERR_FAIL_MSG("Can't load XCursor dynamically.");
	}
#ifdef XKB_ENABLED
	bool xkb_loaded = (initialize_xkbcommon(dylibloader_verbose) == 0);
	xkb_loaded_v05p = xkb_loaded;
	if (!xkb_context_new || !xkb_compose_table_new_from_locale || !xkb_compose_table_unref || !xkb_context_unref || !xkb_compose_state_feed || !xkb_compose_state_unref || !xkb_compose_state_new || !xkb_compose_state_get_status || !xkb_compose_state_get_utf8) {
		xkb_loaded_v05p = false;
		print_verbose("Detected XKBcommon library version older than 0.5, dead key composition and Unicode key labels disabled.");
	}
	xkb_loaded_v08p = xkb_loaded;
	if (!xkb_keysym_to_utf32 || !xkb_keysym_to_upper) {
		xkb_loaded_v08p = false;
		print_verbose("Detected XKBcommon library version older than 0.8, Unicode key labels disabled.");
	}