Automatic measurement of laser diode thermal impedance