### Godot version

0ddd9c3e8f9088fa139e25b2903289d727073e12

### System information

arch linux, google pixel 6

### Issue description

I've found that Android builds of projects are crashing when a touch release event occurs. This issue is only present when the `emulate_mouse_from_touch` setting is set to `false` in the project's settings, and a control node is present in the scene.

Expected result:

The touch release event should be registered without any crashes.

Actual result:

The android build crashes when a touch release event occurs.

### Steps to reproduce

- Create a new project
- Set `emulate_mouse_from_touch` setting to `false`
- Add a button to the main scene
- Build the project for android
- Run the project on android device
- Touch and release on the screen

### Minimal reproduction project

[android-touch-release-crash.zip](https://github.com/godotengine/godot/files/10432336/android-touch-release-crash.zip)

if (k.is_valid()) {
			
			physics_last_mouse_state.alt = k->is_alt_pressed();
			physics_last_mouse_state.shift = k->is_shift_pressed();
			physics_last_mouse_state.control = k->is_ctrl_pressed();
			physics_last_mouse_state.meta = k->is_meta_pressed();
			continue;
		}
		Ref<InputEventScreenDrag> sd = ev;
		if (sd.is_valid()) {
			pos = sd->get_position();
		}
		Ref<InputEventScreenTouch> st = ev;
		if (st.is_valid()) {
			pos = st->get_position();
		}
		if (ss2d) {
			
			uint64_t frame = get_tree()->get_frame();
			PhysicsDirectSpaceState2D::ShapeResult res[64];
			for (const CanvasLayer *E : canvas_layers) {
				Transform2D canvas_layer_transform;
				ObjectID canvas_layer_id;
				if (E) {
					
					canvas_layer_transform = E->get_final_transform();
					canvas_layer_id = E->get_instance_id();
				} else {
					
					canvas_layer_transform = get_canvas_transform();