If an error happened switching to a new variant, we switch back to the previous one ... except it will be unreffed when settin git. In order to avoid such issues, keep a reference to the old variant until we're sure we don't need it anymore Fixes cases of double-free on variants and its contents Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1799>