### 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)
mode_thumbnails->connect("pressed", callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_THUMBNAILS));
	mode_thumbnails->set_toggle_mode(true);
	mode_thumbnails->set_pressed(display_mode == DISPLAY_THUMBNAILS);
	mode_thumbnails->set_button_group(view_mode_group);
	mode_thumbnails->set_tooltip_text(TTR("View items as a grid of thumbnails."));
	pathhb->add_child(mode_thumbnails);
	mode_list = memnew(Button);
	mode_list->set_flat(true);
	mode_list->connect("pressed", callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_LIST));
	mode_list->set_toggle_mode(true);
	mode_list->set_pressed(display_mode == DISPLAY_LIST);
	mode_list->set_button_group(view_mode_group);
	mode_list->set_tooltip_text(TTR("View items as a list."));
	pathhb->add_child(mode_list);
	shortcuts_container = memnew(HBoxContainer);
	pathhb->add_child(shortcuts_container);
	drives = memnew(OptionButton);
	drives->connect("item_selected", callable_mp(this, &EditorFileDialog::_select_drive));
	pathhb->add_child(drives);
	makedir = memnew(Button);
	makedir->set_text(TTR("Create Folder"));
	makedir->connect("pressed", callable_mp(this, &EditorFileDialog::_make_dir));
	pathhb->add_child(makedir);
	list_hb = memnew(HSplitContainer);
	vbc->add_child(pathhb);
	vbc->add_child(list_hb);
	list_hb->set_v_size_flags(Control::SIZE_EXPAND_FILL);
	VSplitContainer *vsc = memnew(VSplitContainer);
	list_hb->add_child(vsc);
	VBoxContainer *fav_vb = memnew(VBoxContainer);