### 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
break;
				case CURSOR_HSPLIT:
					fallback = "sb_h_double_arrow";
					break;
				case CURSOR_HELP:
					fallback = "help";
					break;
			}
			if (fallback != nullptr) {
				cursor_img[i] = XcursorLibraryLoadImage(fallback, cursor_theme, cursor_size);
			}
		}
		if (cursor_img[i]) {
			cursors[i] = XcursorImageLoadCursor(x11_display, cursor_img[i]);
		} else {
			print_verbose("Failed loading custom cursor: " + String(cursor_file[i]));
		}
	}
	{
		
		
		Pixmap cursormask = XCreatePixmap(x11_display,
				RootWindow(x11_display, DefaultScreen(x11_display)), 1, 1, 1);
		
		XGCValues xgc;
		xgc.function = GXclear;
		GC gc = XCreateGC(x11_display, cursormask, GCFunction, &xgc);
		XFillRectangle(x11_display, cursormask, gc, 0, 0, 1, 1);
		
		XColor col = {};