Ensure a total ordering on ChildRefs

Arguably, duplicate sortKeys is a data problem, but we should protect
ourselves against that by using URI as a fallback in the comparison
of ChildRefs in the event of the sortKey being the same.