Graph widget: preserve selection and visibility state of edges during update

The IDs of edges and nodes are unique and can be used as field names in the same
objects (hidden and selected).

Closes acardona/CATMAID#845.