Fix tree-walking compare_entry() in the presense of --prefix