US counterterrorism chief resigns over opposition to Iran war