Hundreds of workers in Massachusetts are expected to lose their jobs after Amazon cut contracts with several last-mile delivery companies.