### 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
const WindowData &wd = windows[p_window];
	if (wd.fullscreen && !_window_fullscreen_check(p_window)) {
		_set_wm_fullscreen(p_window, true, wd.exclusive_fullscreen);
	} else if (wd.maximized && !_window_maximize_check(p_window, "_NET_WM_STATE")) {
		_set_wm_maximized(p_window, true);
	} else if (wd.minimized && !_window_minimize_check(p_window)) {
		_set_wm_minimized(p_window, true);
	}
	if (wd.on_top) {
		Atom wm_state = XInternAtom(x11_display, "_NET_WM_STATE", False);
		Atom wm_above = XInternAtom(x11_display, "_NET_WM_STATE_ABOVE", False);
		XClientMessageEvent xev;
		memset(&xev, 0, sizeof(xev));
		xev.type = ClientMessage;
		xev.window = wd.x11_window;
		xev.message_type = wm_state;
		xev.format = 32;
		xev.data.l[0] = _NET_WM_STATE_ADD;
		xev.data.l[1] = wm_above;
		xev.data.l[3] = 1;
		XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xev);
	}
}
bool DisplayServerX11::window_is_maximize_allowed(WindowID p_window) const {
	_THREAD_SAFE_METHOD_
	return _window_maximize_check(p_window, "_NET_WM_ALLOWED_ACTIONS");
}
void DisplayServerX11::_set_wm_maximized(WindowID p_window, bool p_enabled) {