New Zealand opposition leader quits after poll rout