Restore test compatibility with Python 2.7.
Extract the dedup_fileset function.