Afghan President Ashraf Ghani is warning members of Congress that the Islamic State poses a "terrible threat" to his country and others in its region.