replay: Rework code updating directory states after copyfrom operations
When a path is copied using a copyfrom operation, externals set on the paths being copied must also be set on the copied paths.
Previous implementation was using the latest externals values set on the paths being copied but those could differ from the ones set at revision copyfrom_rev so ensure to set correct externals on the copied paths.