With time running out, Taiwanese lawmakers approved funds for buying U.S. weapons, fearing they could lose support if they didn’t act now.