Ditech Deal With Homeowners Paves Way for $1.8 Billion Sale