U.S. Africa Command is shifting its strategy to focus on containing al-Qaida and Islamic State affiliates and other militant groups, according to reports and comments from Pentagon officials.