Fix several bugs in complete hyperedge rerouting.

This change fixes:
 *  A bug with the vertex and bridging edge heaps used for hyperedge
    rerouting becoming unordered.
 *  A rare bug where hyperedge rerouting could return a different hyperedge
    missing one or more of its original terminals.