Upgrade duplicity to use os.scandir() instead of os.listdir()
Currently duplicity uses os.listdir() to list directories and os.stat() calls to determine file types, etc. It would be much faster if we used os.scandir() which returns os.DirEntry structures which contain the stats we need without the overhead of additional system calls for each path.
The work on hard links showed that scandir was about four times faster than listdir for directory processing.