### Godot version

4.1.dev (dc625bcbfc5b587ba8867481ee7a1f6a567c25d0)

### System information

Mageia 9, Linux

### Issue description

When importing a project in current `master`, the following error is raised for each asset that gets imported:
```
Attempting to parent and popup a dialog that already has a parent.
```

It seems to be raised once per asset, caused by the progress dialog.

CC @bruvzg

### Steps to reproduce

- Import a new project in Godot that contains importable assets, e.g. https://github.com/RPicster/godot4-demo-desert-light

### Minimal reproduction project

See above.
ERR_MAIN_THREAD_GUARD;
	wrap_controls = p_enable;
	if (!is_inside_tree()) {
		return;
	}
	if (updating_child_controls) {
		_update_child_controls();
	} else {
		_update_window_size();
	}
}
bool Window::is_wrapping_controls() const {
	ERR_READ_THREAD_GUARD_V(false);
	return wrap_controls;
}
Size2 Window::_get_contents_minimum_size() const {
	Size2 max;
	for (int i = 0; i < get_child_count(); i++) {
		Control *c = Object::cast_to<Control>(get_child(i));
		if (c) {
			Point2i pos = c->get_position();
			Size2i min = c->get_combined_minimum_size();
			max.x = MAX(pos.x + min.x, max.x);
			max.y = MAX(pos.y + min.y, max.y);
		}
	}
	return max;
}
void Window::child_controls_changed() {