Select the max distance_to_top between last two merging neighbours
Select the max distance_to_top between last two merging neighbours

When there were only two neighours left and they were about to be merged together, the distance
to top of the new node was selected based on which of the two neighbouring nodes the code was
going through first.

If the two nodes had a big difference between their distsance_to_top values, selecting one of the
two for the new node would sometimes select the max one (which is the correct), while in some cases
it would select the smaller one. This was entirely dependend on which node was being "looked at"
first.

When the min of the two was selected for the new node, the jump in the branch diameter happened,
since the branch diameter is affected by the distance_to_top of the node.

This commit fixes that by correctly selecting the maximum distance_to_top between the two
neighbouring nodes.

Should fix https://github.com/Ultimaker/Cura/issues/7711

CURA-7713

Ultimaker/CuraEngine,Ultimaker/CuraEngine