Australian PM to take office after election drama