Algeria are through to the knockout rounds of the Africa Cup of Nations thanks to Riyad Mahrez's penalty in their 1-0 victory over Burkina Faso.