Handle files in Filesystem::copyThenRemove, fixes #3287