### 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
XChangeProperty(x11_display, wd.x11_window, xdnd_aware, XA_ATOM, 32, PropModeReplace, (unsigned char *)&xdnd_version, 1);
		}
		if (xim && xim_style) {
			
			
			MutexLock mutex_lock(events_mutex);
			
			if ((xim_style & XIMPreeditPosition) != 0) {
				xim_style &= ~XIMPreeditPosition;
				xim_style |= XIMPreeditCallbacks;
			}
			if ((xim_style & XIMPreeditCallbacks) != 0) {
				::XIMCallback preedit_start_callback;
				preedit_start_callback.client_data = (::XPointer)(this);
				preedit_start_callback.callback = (::XIMProc)(void *)(_xim_preedit_start_callback);
				::XIMCallback preedit_done_callback;
				preedit_done_callback.client_data = (::XPointer)(this);
				preedit_done_callback.callback = (::XIMProc)(_xim_preedit_done_callback);
				::XIMCallback preedit_draw_callback;
				preedit_draw_callback.client_data = (::XPointer)(this);
				preedit_draw_callback.callback = (::XIMProc)(_xim_preedit_draw_callback);
				::XIMCallback preedit_caret_callback;
				preedit_caret_callback.client_data = (::XPointer)(this);
				preedit_caret_callback.callback = (::XIMProc)(_xim_preedit_caret_callback);
				::XVaNestedList preedit_attributes = XVaCreateNestedList(0,
						XNPreeditStartCallback, &preedit_start_callback,
						XNPreeditDoneCallback, &preedit_done_callback,
						XNPreeditDrawCallback, &preedit_draw_callback,
						XNPreeditCaretCallback, &preedit_caret_callback,
						(char *)nullptr);