vfs::GetPathnames currently clears the pathnames vector to which it appends path names. This is useless because we always create the vector right before calling GetPathnames, and it makes it annoying to repeatedly call GetPathnames (see D1858 for a possible use case).
This adds tests to make sure we don't break the behaviour at some point.