Nigeria held off a late Tunisia fightback to reach the last 16 of the 2025 Africa Cup of Nations (Afcon) in Morocco.