Macy’s beat earnings estimates as the department store operator moves to close about 150 namesake locations and open new Bloomingdale’s and Bluemercury stores.