Generalize Comparison of DirectoryEntry structure

This generalizes the comparison of two directory entries. It was taken from swissknife_check. I will need this comparison functionality also in swissknife_migration.