A purge of military elite shows the risk of a sudden surge in military spending—and of crossing Xi Jinping.