Correctly detect same-generation loops

Join threads when they have not passed the current pc in the current generation.
Do this instead of removing one of the threads. The cyclic traces only occur when passing the same instruction multiple times within the same generation.