This is to work around a race where the pad is accessed in the
webrtc main thread while being released.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
if (webrtc_pad->trans)
gst_object_unref (webrtc_pad->trans);
webrtc_pad->trans = NULL;
if (webrtc_pad->trans)
gst_object_unref (webrtc_pad->trans);
webrtc_pad->trans = NULL;
+ gst_caps_replace (&webrtc_pad->received_caps, NULL);
PC_UNLOCK (webrtc);
_remove_pad (webrtc, webrtc_pad);
PC_UNLOCK (webrtc);
_remove_pad (webrtc, webrtc_pad);