Red Sox acquire ex-All-Star infielder in trade with NL team