Do not use a N² algorithm when merging waypoints sets

The prefix of a waypoint must be unique for a given cache, so use that
instead of the name for merging (the name needs not be unique).

Also, it won't break if we have duplicate prefixes in the old waypoints
list, those will be kept as well in the new list.