WASHINGTON  President Obama, apparently resigned to President Hamid Karzai’s refusal to sign a long-term security agreement with the United States before he leaves office, told him in a phone call on Tuesday that he had instructed the Pentagon to begin planning for a complete withdrawal of American troops from Afghanistan by the end of the year.