replay: Robustify external path removal implementation
When removing the subpaths of an external path, we first need to check
if a subpath is not versioned instead of checking if it is empty.
If a subpath is versioned, we can stop the paths removal process.
Relate to T3870