The commander, Gen. Kenneth F. McKenzie Jr., said U.S. forces would continue to combat pockets of Islamic State fighters.