Thermal instabilites in semiconductor amplifiers