Fix a nasty bug in sorted graph iterators.

The sorting method we were using was relying on TreeSet and a
comparator. The problem is that when two objects have the same value
(for the comparator), TreeSet simply prunes one of them.

Because this is what we were using in depth-first iterator, if two
branches had the same name, one of them was simply not iterated at all.
We now rely on list and Collections.sort() to build sorted iterator.

Noted by Anastasios Pavlopoulos the Great.
Signed-off-by: Jean-Yves Tinevez <jean-yves.tinevez@pasteur.fr>