Berejiklian wins majority as Daley quits