Crisis presents a threat to both Islamic State group and al-Qaeda, but some of their fighters also see the upheaval as an opportunity