### Godot version

v4.1.1.stable.official [bd6af8e0e]

### System information

Godot v4.1.1.stable - Debian GNU/Linux 12 (bookworm) 12 - Vulkan (Forward+) - integrated Intel(R) HD Graphics 5500 (BDW GT2) () - Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz (4 Threads)

### Issue description

Attempting to open a child window from a window while having the `focus_exited` signal connected to the `hide` method, crashes Godot with signal 4 (SIGILL)
I have a backtrace, though it may not really be useful, since I didn't want to make my own build of godot with debug symbols. I hope however that the MRE makes up for the lack of a proper backtrace on my side.
```
================================================================
handle_crash: Program crashed with signal 4
Engine version: Godot Engine v4.1.1.stable.official (bd6af8e0ea69167dd0627f3bd54f9105bda0f8b5)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x3bf90) [0x7f586db17f90] (??:0)
[2] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x2d5f7b6] (??:0)
[3] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x2d5fa78] (??:0)
[4] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x2dfcdf7] (??:0)
[5] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x2dfd587] (??:0)
[6] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x2dfe1b9] (??:0)
[7] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x2d98f17] (??:0)
[8] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x47d7128] (??:0)
[9] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x461cac4] (??:0)
[10] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x483b9d1] (??:0)
[11] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x2ded3de] (??:0)
[12] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x2dede9d] (??:0)
[13] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x2d365f0] (??:0)
[14] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x2d7c325] (??:0)
[15] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x2d7f9ec] (??:0)
[16] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x2d802e4] (??:0)
[17] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x2da6ca5] (??:0)
[18] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0xeb6b10] (??:0)
[19] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x45be723] (??:0)
[20] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0x45bf97e] (??:0)
[21] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0xeb71bf] (??:0)
[22] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0xe46433] (??:0)
[23] /lib/x86_64-linux-gnu/libc.so.6(+0x2718a) [0x7f586db0318a] (??:0)
[24] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85) [0x7f586db03245] (??:0)
[25] /home/monix/.local/share/hourglass/versions/4.1.1/godot() [0xe777ae] (??:0)
-- END OF BACKTRACE --
================================================================
```
What I expect to happen instead:
Either the engine failing with a proper error, or hiding the window, or keeping both windows visible.

### Steps to reproduce

Download, and run the MRE
Press the Browse button in the window that appears
Crash occurs

### Minimal reproduction project

[sigill-mre.zip](https://github.com/godotengine/godot/files/12383126/sigill-mre.zip)

RS::get_singleton()->canvas_item_clear(sw.canvas_item);
	Rect2i r = Rect2i(p_window->get_position(), sw.window->get_size());
	if (!p_window->get_flag(Window::FLAG_BORDERLESS)) {
		Ref<StyleBox> panel = p_window->get_theme_stylebox(gui.subwindow_focused == p_window ? SNAME("embedded_border") : SNAME("embedded_unfocused_border"));
		panel->draw(sw.canvas_item, r);
		
		Ref<Font> title_font = p_window->get_theme_font(SNAME("title_font"));
		int font_size = p_window->get_theme_font_size(SNAME("title_font_size"));
		Color title_color = p_window->get_theme_color(SNAME("title_color"));
		int title_height = p_window->get_theme_constant(SNAME("title_height"));
		int close_h_ofs = p_window->get_theme_constant(SNAME("close_h_offset"));
		int close_v_ofs = p_window->get_theme_constant(SNAME("close_v_offset"));
		TextLine title_text = TextLine(p_window->atr(p_window->get_title()), title_font, font_size);
		title_text.set_width(r.size.width - panel->get_minimum_size().x - close_h_ofs);
		title_text.set_direction(p_window->is_layout_rtl() ? TextServer::DIRECTION_RTL : TextServer::DIRECTION_LTR);
		int x = (r.size.width - title_text.get_size().x) / 2;
		int y = (-title_height - title_text.get_size().y) / 2;
		Color font_outline_color = p_window->get_theme_color(SNAME("title_outline_modulate"));
		int outline_size = p_window->get_theme_constant(SNAME("title_outline_size"));
		if (outline_size > 0 && font_outline_color.a > 0) {
			title_text.draw_outline(sw.canvas_item, r.position + Point2(x, y), outline_size, font_outline_color);
		}
		title_text.draw(sw.canvas_item, r.position + Point2(x, y), title_color);
		bool pressed = gui.subwindow_focused == sw.window && gui.subwindow_drag == SUB_WINDOW_DRAG_CLOSE && gui.subwindow_drag_close_inside;
		Ref<Texture2D> close_icon = p_window->get_theme_icon(pressed ? "close_pressed" : "close");
		close_icon->draw(sw.canvas_item, r.position + Vector2(r.size.width - close_h_ofs, -close_v_ofs));
	}
	RS::get_singleton()->canvas_item_add_texture_rect(sw.canvas_item, r, sw.window->get_texture()->get_rid());
}
void Viewport::_sub_window_grab_focus(Window *p_window) {