Fix worktree entry IDs for symlinked files (#57846)