Washington’s adversaries, including Iran and the Islamic State, are likely to take advantage of the pullout.