Fix a bug in circularity detection of poset.
Adding a junit to test for circularity in subsorts.
Merge pull request #1040 from kframework/fixCircularity

Fix a bug in circularity detection of poset.