Phase-sensitive lock-in detection of semiconductor waveguide intensity profiles