fix bug in exhaustiveness check of patterns

When defining constants using top level pattern compilation,
the exhaustiveness of the derived set of patterns needs to be proved.
The changes to the pattern-compilation heuristics caused this completeness
check to fail in seldom cases. This checkin should hopefully fix the problem.

The new heuristics allow columns during pattern reconstruction, which contain
both literals and constructors. These can't be handled. By processing the
columns in a different order, this problem should be avoided.