The leader used X to vault from obscurity to power. Now his social-media feuds are alienating potential allies and frustrating voters.