res_pjsip: PJSIP Transport state monitor refactor.