An unexpected victory for an opposition candidate has panicked an unpopular government into cancelling the contest altogether