Made PSO cycle detection more general.

It incorrectly assumed that the overtaking write would be connected by a read,
where it actually might be a write.