Politicians and generals struggle with public opinion over Afghanistan