StageOutImplV2 plugin: improve detection of local files. Fixes #5255