Libya ended Senegal's miserable Africa Cup of Nations, and ensured one of the pre-tournament favourites went home without a single point.