Daley quits as Berejiklian wins majority