### Godot version

4.0 9f68d06

### System information

Windows 10 x64

### Issue description

When changing any property of tile source, e.g. name:
![image](https://user-images.githubusercontent.com/2223172/219977766-9babbd6c-cd75-41a0-a167-fe6da039d05e.png)
This error appears in the output:
```
UndoRedo history mismatch: expected 0, got 2.
Set name
```
It means that there is an undo action that starts with a global object and continues with a scene one.

Only happens when the TileSet is built-in and it makes the changes to the tileset being registered as global, i.e. not related to its scene (which results in history inconsistency after closing the scene).

I did some debugging and the action comes from inspector, which edits TileSetAtlasSourceEditor and then TileSetAtlasSource. I don't know what exactly triggers it; the properties should be only set on TileSetAtlasSource.

### Steps to reproduce

1. Add scene
2. Add tilemap
3. Add tileset (don't save it to a file)
4. Edit tileset
5. Add atlas source (e.g. drop icon.svg)
6. Change atlas name
7. Observe output

### Minimal reproduction project

N/A
scene_tabs->connect("tab_close_pressed", callable_mp(this, &EditorNode::_scene_tab_closed).bind(SCENE_TAB_CLOSE));
	scene_tabs->connect("tab_hovered", callable_mp(this, &EditorNode::_scene_tab_hovered));
	scene_tabs->connect("mouse_exited", callable_mp(this, &EditorNode::_scene_tab_exit));
	scene_tabs->connect("gui_input", callable_mp(this, &EditorNode::_scene_tab_input));
	scene_tabs->connect("active_tab_rearranged", callable_mp(this, &EditorNode::_reposition_active_tab));
	scene_tabs->connect("resized", callable_mp(this, &EditorNode::_update_scene_tabs));
	scene_tabs->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	tabbar_container->add_child(scene_tabs);
	scene_tabs_context_menu = memnew(PopupMenu);
	tabbar_container->add_child(scene_tabs_context_menu);
	scene_tabs_context_menu->connect("id_pressed", callable_mp(this, &EditorNode::_menu_option));
	scene_tab_add = memnew(Button);
	scene_tab_add->set_flat(true);
	scene_tab_add->set_tooltip_text(TTR("Add a new scene."));
	scene_tab_add->set_icon(gui_base->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
	scene_tab_add->add_theme_color_override("icon_normal_color", Color(0.6f, 0.6f, 0.6f, 0.8f));
	scene_tabs->add_child(scene_tab_add);
	scene_tab_add->connect("pressed", callable_mp(this, &EditorNode::_menu_option).bind(FILE_NEW_SCENE));
	scene_tab_add_ph = memnew(Control);
	scene_tab_add_ph->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
	scene_tab_add_ph->set_custom_minimum_size(scene_tab_add->get_minimum_size());
	tabbar_container->add_child(scene_tab_add_ph);
	distraction_free = memnew(Button);
	distraction_free->set_flat(true);
	ED_SHORTCUT_AND_COMMAND("editor/distraction_free_mode", TTR("Distraction Free Mode"), KeyModifierMask::CTRL | KeyModifierMask::SHIFT | Key::F11);
	ED_SHORTCUT_OVERRIDE("editor/distraction_free_mode", "macos", KeyModifierMask::META | KeyModifierMask::CTRL | Key::D);
	distraction_free->set_shortcut(ED_GET_SHORTCUT("editor/distraction_free_mode"));
	distraction_free->set_tooltip_text(TTR("Toggle distraction-free mode."));
	distraction_free->connect("pressed", callable_mp(this, &EditorNode::_toggle_distraction_free_mode));
	distraction_free->set_icon(gui_base->get_theme_icon(SNAME("DistractionFree"), SNAME("EditorIcons")));