Negotiators appear close to a final opioid settlement meant to resolve a tsunami of lawsuits against some of the nation’s biggest drugmakers and distributors.