Improve detection of duplicates during scan.
Improve detection of duplicates during scan.

There are two kinds of duplicates: files that are actual the same
file on the filesystem, and files that have duplicate UIDs.  The
former is a subset of the latter.

The code used to check for the former first, but the "realpath()"
system call was expensive (it was taking 30% of the total run time).
Now, it first checks for duplicate UID and InstanceNumber, and
only then performs a system call to check the file identity.

dgobbi/vtk-dicom,dgobbi/vtk-dicom,dgobbi/vtk-dicom