Sort the nexthops of a group by metric first and by index second,
and keep the metric of each nexthop in the unused storage field. The
nexthops with the lowest metric are the first ones in the array.
The group is sized and compiled from them without visiting every
nexthop for its metric, and the metric argument of these functions
goes away.
decompose_change_notification() walks two groups in their sort
order, so make it use the same comparison.