Many publicly traded mortgage companies remained profitable in the second quarter, though earnings were down sharply. (Includes data chart.)