In Ballmer’s final years, Microsoft scrambled to reimagine Windows so that it could fit on any screen, build mobile devices that people would adore, and continue to fend off threats in both the office and the living room.