Fix a race condition in res_pjsip_session with rapidly terminating the session.