### 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
distraction_free->set_toggle_mode(true);
	tabbar_container->add_child(distraction_free);
	scene_root_parent = memnew(PanelContainer);
	scene_root_parent->set_custom_minimum_size(Size2(0, 80) * EDSCALE);
	scene_root_parent->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("Content"), SNAME("EditorStyles")));
	scene_root_parent->set_draw_behind_parent(true);
	srt->add_child(scene_root_parent);
	scene_root_parent->set_v_size_flags(Control::SIZE_EXPAND_FILL);
	scene_root = memnew(SubViewport);
	scene_root->set_embedding_subwindows(true);
	scene_root->set_disable_3d(true);
	scene_root->set_disable_input(true);
	scene_root->set_as_audio_listener_2d(true);
	main_screen_vbox = memnew(VBoxContainer);
	main_screen_vbox->set_name("MainScreen");
	main_screen_vbox->set_v_size_flags(Control::SIZE_EXPAND_FILL);
	main_screen_vbox->add_theme_constant_override("separation", 0);
	scene_root_parent->add_child(main_screen_vbox);
	bool global_menu = !bool(EDITOR_GET("interface/editor/use_embedded_menu")) && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU);
	bool can_expand = bool(EDITOR_GET("interface/editor/expand_to_title")) && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_EXTEND_TO_TITLE);
	if (can_expand) {
		
		left_menu_spacer = memnew(Control);
		left_menu_spacer->set_mouse_filter(Control::MOUSE_FILTER_PASS);
		title_bar->add_child(left_menu_spacer);
	}
	main_menu = memnew(MenuBar);
	title_bar->add_child(main_menu);
	main_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles")));
	main_menu->set_flat(true);