Junction temperature measurement in optically-Controlled power mosfet