Ensures edge indexes are sorted according to both head and tail.

_indexHead is sorted primarily according to _head values, but
should be sorted secondarily with respect to _tail.  Similarly,
_indexTail is sorted primarily according to _tail values, but
should be sorted secondarily with respect to _head.

This ensures that e.g. the output of neighbours() will be sorted.
It can also be used to speed up e.g. isEdge and edgeID calculations.

Thanks are due to John Colvin and bearophile for pointing me to the
solution for indexEdgesSort() :-)