Rate of foreclosures falls in second quarter