Abdellah Ouazane's first-half goal secured a 1-0 victory over Niger as Morocco booked their place at AFCON 2027 with two games to spare.