Microsoft announced plans Wednesday to restructure the company’s phone hardware business and to cut up to 7,800 positions.