Fix a bug in circularity detection of poset.

I'm not sure how we didn't detect this one until now, but it was a bug in the actual algorithm.
@dwightguth please review.