editor: make algorithm for choosing num for bond and bridge deterministic

The previous algorithm for choosing bond_num/bridge_num is not deterministic.

It does neither choose one of
  (a) MAX(existing nums) + 1
  (b) MIN(unused nums)

What it actually chooses depends on the order how the existing
connections are returned. For example:
  [0 2] => 1
  [2 0] => 3

This commit changes the algorithm to use (a).

Signed-off-by: Thomas Haller <thaller@redhat.com>