The war in Iran has left China’s neighbors appealing for help, handing Beijing the kind of sway it has long sought.