Non-equilibrium LO and TO phonon generation by electron transport in terahertz quantum cascade lasers