configure: rework the way TIRPC is detected and handled