Evolution of violent gravitational disc instability in galaxies: late stabilization by transition from gas to stellar dominance