### 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
Atom client_list_prop = XInternAtom(x11_display, "_NET_CLIENT_LIST", True);
		if (client_list_prop != None) {
			unsigned long clients_len = 0;
			unsigned char *clients_data = nullptr;
			if (XGetWindowProperty(x11_display, x11_window, client_list_prop, 0, LONG_MAX, False, XA_WINDOW, &type, &format, &clients_len, &remaining, &clients_data) == Success) {
				if ((format == 32) && (clients_len > 0) && clients_data) {
					Window *windows_data = (Window *)clients_data;
					Rect2i desktop_rect;
					bool desktop_valid = false;
					
					{
						Atom desktop_geometry_prop = XInternAtom(x11_display, "_NET_DESKTOP_GEOMETRY", True);
						if (desktop_geometry_prop != None) {
							unsigned long geom_len = 0;
							unsigned char *geom_data = nullptr;
							if (XGetWindowProperty(x11_display, x11_window, desktop_geometry_prop, 0, LONG_MAX, False, XA_CARDINAL, &type, &format, &geom_len, &remaining, &geom_data) == Success) {
								if ((format == 32) && (geom_len >= 2) && geom_data) {
									desktop_valid = true;
									long *size_data = (long *)geom_data;
									desktop_rect.size.x = size_data[0];
									desktop_rect.size.y = size_data[1];
								}
							}
							if (geom_data) {
								XFree(geom_data);
							}
						}
					}