Stochastic base doping and quantum-well enhancement of recombination in an n-p-n light-emitting transistor or transistor laser