### 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
rect.position.y = xsi[p_screen].y_org;
			rect.size.width = xsi[p_screen].width;
			rect.size.height = xsi[p_screen].height;
		} else {
			ERR_PRINT("Invalid screen index: " + itos(p_screen) + "(count: " + itos(count) + ").");
		}
		if (xsi) {
			XFree(xsi);
		}
	} else {
		int count = XScreenCount(x11_display);
		if (p_screen < count) {
			Window root = XRootWindow(x11_display, p_screen);
			XWindowAttributes xwa;
			XGetWindowAttributes(x11_display, root, &xwa);
			rect.position.x = xwa.x;
			rect.position.y = xwa.y;
			rect.size.width = xwa.width;
			rect.size.height = xwa.height;
		} else {
			ERR_PRINT("Invalid screen index: " + itos(p_screen) + "(count: " + itos(count) + ").");
		}
	}
	return rect;
}
Point2i DisplayServerX11::screen_get_position(int p_screen) const {
	_THREAD_SAFE_METHOD_
	return _screen_get_rect(p_screen).position;
}
Size2i DisplayServerX11::screen_get_size(int p_screen) const {