### Godot version

4.1.1

### System information

linux

### Issue description

- When favoriting a path in a `FileDialog`, clicking on it travels to `path/to/dir/`.
- When going up a level from there, it doesn't go to `path/to` but to `path/to/dir` (without the `/`).

[simplescreenrecorder-2023-08-18_09.38.37.webm](https://github.com/godotengine/godot/assets/71937306/00c20ad3-292f-4961-84ed-dbc64906df52)

The problem is either (or both) that:
 - loaded path has a trailing `/`
 - parent dir of `stuff/` is considered to be `stuff`

### Steps to reproduce

favorite a directory and use the feature to navigate to it

### Minimal reproduction project

any (i.e. the project manager's "new project" dialog has one)
ConfirmationDialog::_update_theme_item_cache();
	theme_cache.parent_folder = get_editor_theme_icon(SNAME("ArrowUp"));
	theme_cache.forward_folder = get_editor_theme_icon(SNAME("Forward"));
	theme_cache.back_folder = get_editor_theme_icon(SNAME("Back"));
	theme_cache.reload = get_editor_theme_icon(SNAME("Reload"));
	theme_cache.toggle_hidden = get_editor_theme_icon(SNAME("GuiVisibilityVisible"));
	theme_cache.favorite = get_editor_theme_icon(SNAME("Favorites"));
	theme_cache.mode_thumbnails = get_editor_theme_icon(SNAME("FileThumbnail"));
	theme_cache.mode_list = get_editor_theme_icon(SNAME("FileList"));
	theme_cache.favorites_up = get_editor_theme_icon(SNAME("MoveUp"));
	theme_cache.favorites_down = get_editor_theme_icon(SNAME("MoveDown"));
	theme_cache.folder = get_editor_theme_icon(SNAME("Folder"));
	theme_cache.folder_icon_color = get_theme_color(SNAME("folder_icon_color"), SNAME("FileDialog"));
	theme_cache.action_copy = get_editor_theme_icon(SNAME("ActionCopy"));
	theme_cache.action_delete = get_editor_theme_icon(SNAME("Remove"));
	theme_cache.filesystem = get_editor_theme_icon(SNAME("Filesystem"));
	theme_cache.folder_medium_thumbnail = get_editor_theme_icon(SNAME("FolderMediumThumb"));
	theme_cache.file_medium_thumbnail = get_editor_theme_icon(SNAME("FileMediumThumb"));
	theme_cache.folder_big_thumbnail = get_editor_theme_icon(SNAME("FolderBigThumb"));
	theme_cache.file_big_thumbnail = get_editor_theme_icon(SNAME("FileBigThumb"));
	theme_cache.progress[0] = get_editor_theme_icon("Progress1");
	theme_cache.progress[1] = get_editor_theme_icon("Progress2");
	theme_cache.progress[2] = get_editor_theme_icon("Progress3");
	theme_cache.progress[3] = get_editor_theme_icon("Progress4");
	theme_cache.progress[4] = get_editor_theme_icon("Progress5");
	theme_cache.progress[5] = get_editor_theme_icon("Progress6");
	theme_cache.progress[6] = get_editor_theme_icon("Progress7");
	theme_cache.progress[7] = get_editor_theme_icon("Progress8");
}
void EditorFileDialog::_notification(int p_what) {