res_pjsip_pubsub: Solidify lifetime and ownership of objects.