Liberty Mutual said the decision to lay off a percentage of its Massachusetts workforce will "set up our company for the future and support long-lasting success."