Abort equivalence set recomputation earlier when over-sized

Refactor `TransitiveLookupWriter` and its method for reading existing
transitive sets such that the process is aborted as the set of required
entries grows too large not once the entire set has been computed or
after it's been resolved (as before).

Other alterations attempt to avoid unnecessary copying of
collections/iterables and repeated work.