Senegal beat Morocco to win the Africa Cup of Nations after the final is overshadowed when they temporarily refuse to play.