US spy agencies more pessimistic on Afghan war