Yet another drastic revision to the conflict detector.

It should no longer get stuck in an infinite loop on systems with
lots of conflicting headers.  (Thanks everso, Apple.)