The threat of a terrorist attack led to the weekend closure of 21 U.S. embassies and consulates in the Muslim world and a global travel warning to Americans, the first such alert since an announcement before the 10th anniversary of the Sept. 11 strikes.