Removed sortRules() from RuleCollection interface and ensured that calls to
getSortedRules() and isSorted() are synchronized in both BasicRuleCollection
and the packed grammar. This is an attempt to deal with a bug where many threads
can cause a contract violation exception in rule sorting.