Due diligence, done early in merger talks, should prevent any surprises about litigation against a law firm.