layout manager: add a check if the widget exists

Avoid a crash when calling _gtk_widget_get_first_child
Fixes https://github.com/gtk-rs/gtk4-rs/issues/889
13 jobs for bilelmoussaoui/layout-manager in 53 minutes and 4 seconds (queued for 5 seconds)