Fix candidate file comparison when using path ids

The function `CompareCandidateFile` incorrectly compares a file's `path_id` against itself and will always return false.

This is my first pull request; I have completed the CLA.