sort pattern duplicates to avoid order issues now that hash values have
changed in Clojure 1.6.0