The number of bankruptcy filings in Massachusetts surged by 25 percent in the first six months of the year, as many consumers struggled with job losses, changing credit card terms and foreclosures. The Warren Group reported Thursday that through June 30, 11,847 filers statewide sought protection through Chapter 7, Chapter 11 or Chapter 13 of the federal bankruptcy code. That figure, which includes businesses and individuals, represents a 25.2 percent increase from the same January-June period in 2009. The sharp rise could put the state on track to surpass the rush of bankruptcies in 2005, before strict limits took effect....