US counterterrorism chief resigns