The layoffs are related to Flagstar Bank's sale of its mortgage servicing business to Dallas-based Mr. Cooper.