Only a handful of top aides knew the president’s plan to travel to Afghanistan for the first time on Thanksgiving.