Cambridge (MA) Health Alliance has announced that it will reduce its workforce by more than 300 employees, end inpatient services at Somerville Hospital, and shut down its pediatric and addiction units. The three-hospital system has been struggling with its finances for at least a year, but state budget cuts last fall and the recession made the situation more dire, executives said.