surface: fix memory leak through unreleased parent context.
surface: fix memory leak through unreleased parent context.

Break the circular references between GstVaapiContext and its children
GstVaapiSurfaces. Since the VA surfaces held an extra reference to the
context, which holds a reference to its VA surfaces, then none of those
were released.

How does this impact support for subpictures?

The only situation when the parent context needs to disappear is when
it is replaced with another one because of a resolution change in the
video stream for instance, or a normal destroy. In this case, it does
not really matter to apply subpictures to the peer surfaces since they
are either gone, or those that are left in the pipe can probably bear
a reinstantiation of the subpictures for it.

So, parent_context is set to NULL when the parent context is destroyed,
other VA surfaces can still get subpictures attached to them, individually
not as a whole. i.e. subpictures for surface S1 will be created from
active composition buffers and associated to S1, subpictures for S2 will
be created from the next active composition buffers, etc. We don't try
to cache the subpictures in those cases (pending surfaces until EOS
is reached, or pending surfaces until new surfaces matching new VA context
get to be used instead).

CapOM/gstreamer-vaapi,CapOM/gstreamer-vaapi,01org/iotg-lin-gfx-gstreamer-vaapi,01org/iotg-lin-gfx-gstreamer-vaapi,ceyusa/gstreamer-vaapi,gbeauchesne/gstreamer-vaapi,gbeauchesne/gstreamer-vaapi,CapOM/gstreamer-vaapi,ceyusa/gstreamer-vaapi,GStreamer/gstreamer-vaapi,01org/iotg-lin-gfx-gstreamer-vaapi,GStreamer/gstreamer-vaapi,gbeauchesne/gstreamer-vaapi