Concerns about a terrorist resurgence in Afghanistan are valid, but there are greater terrorist threats in the world today. In particular, there are thousands of ISIS fighters roaming around northern Iraq and eastern Syria.
Currently, the United States doesn't really have a strategy to combat and contain ISIS in Iraq and Syria. On paper, there is a strategy, but in practice it is a series of transactions and tactics that could unwind at any moment. The counter-ISIS fight in Syria is entirely dependent on maintaining a security agreement with Iraq. Each change in government in Iraq, as is happening now, puts that agreement in jeopardy.
Even if the agreement stays in place, the mission in Syria will be scuttled sooner or later when Bashar al-Assad decides to retake eastern Syria. When that happens, the Kurdish-led counterterrorism force that the United States sponsors will either join the Syrian regime or fade away. Either outcome will benefit ISIS.
What to do? Go big. Create an independent Kurdistan.
While that would be opposed by most in the region, it would be the most effective way of keeping ISIS down. Kurdish forces are the best in the region. They are a strong American ally. They will welcome U.S. support and counterterrorism forces. Plus, creating a Kurdish state will reduce the amount of territory that Baghdad and Damascus need to govern and secure, which will enable them to deploy their CT resources more effectively.
It's a longshot to say the least, but it's by far the best bet for long-term stability and security.