media library: fix path history for items with a real path differing from the requested path

Same as #5941 but for Helix.