### 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
double rel_x = 0.0;
						double rel_y = 0.0;
						if (XIMaskIsSet(raw_event->valuators.mask, VALUATOR_ABSX)) {
							rel_x = *values;
							values++;
						}
						if (XIMaskIsSet(raw_event->valuators.mask, VALUATOR_ABSY)) {
							rel_y = *values;
							values++;
						}
						if (XIMaskIsSet(raw_event->valuators.mask, VALUATOR_PRESSURE)) {
							HashMap<int, Vector2>::Iterator pen_pressure = xi.pen_pressure_range.find(device_id);
							if (pen_pressure) {
								Vector2 pen_pressure_range = pen_pressure->value;
								if (pen_pressure_range != Vector2()) {
									xi.pressure_supported = true;
									xi.pressure = (*values - pen_pressure_range[0]) /
											(pen_pressure_range[1] - pen_pressure_range[0]);
								}
							}
							values++;
						}
						if (XIMaskIsSet(raw_event->valuators.mask, VALUATOR_TILTX)) {
							HashMap<int, Vector2>::Iterator pen_tilt_x = xi.pen_tilt_x_range.find(device_id);
							if (pen_tilt_x) {
								Vector2 pen_tilt_x_range = pen_tilt_x->value;
								if (pen_tilt_x_range[0] != 0 && *values < 0) {
									xi.tilt.x = *values / -pen_tilt_x_range[0];
								} else if (pen_tilt_x_range[1] != 0) {
									xi.tilt.x = *values / pen_tilt_x_range[1];