Senegal beat Morocco 1-0 in a chaotic final to claim their second Africa Cup of Nations title after a dramatic extra-time winner by Pape Gueye.