US president will need to deal with the some 200 Americans and thousands of Afghans left behind, the resettlement of tens of thousands of refugees, and internal scrutiny