queue: remove query from queue if queue is flushing
queue: remove query from queue if queue is flushing

When querying a queue that is flushing we end up adding
a query to the queuearray without taking a reference to
that query (because the normal functionality is to block
until that query is done and discarded from the queue).
This later causes problem if the query is unreffed outside
of the queue before we discard the queue. There is a check
to avoid unreffing any lingering query-objects, but since
the query has been deleted that check fails.

This commit depends on other fixes done to gst_queue_array_find()
and gst_queue_array_drop_element().

https://bugzilla.gnome.org/show_bug.cgi?id=692691

krieger-od/gstreamer,ensonic/gstreamer,collects/gstreamer,krichter722/gstreamer,surround-io/gstreamer,justinjoy/gstreamer,centricular/gstreamer,lovebug356/gstreamer,cfoch/gstreamer,jpxiong/gstreamer,jpxiong/gstreamer,krichter722/gstreamer,cfoch/gstreamer,jpakkane/gstreamer,lubosz/gstreamer,centricular/gstreamer,cablelabs/gstreamer,mparis/gstreamer,StreamUtils/gstreamer,lubosz/gstreamer,surround-io/gstreamer,lubosz/gstreamer,ensonic/gstreamer,shelsonjava/gstreamer,mparis/gstreamer,Lachann/gstreamer,cfoch/gstreamer,jpakkane/gstreamer,krieger-od/gstreamer,shelsonjava/gstreamer,jpxiong/gstreamer,cablelabs/gstreamer,lovebug356/gstreamer,justinjoy/gstreamer,cablelabs/gstreamer,lovebug356/gstreamer,krieger-od/gstreamer,krichter722/gstreamer,jpxiong/gstreamer,shelsonjava/gstreamer,Lachann/gstreamer,collects/gstreamer,cfoch/gstreamer,Lachann/gstreamer,StreamUtils/gstreamer,lovebug356/gstreamer,justinjoy/gstreamer,centricular/gstreamer,justinjoy/gstreamer,lubosz/gstreamer,lovebug356/gstreamer,cablelabs/gstreamer,collects/gstreamer,ensonic/gstreamer,lubosz/gstreamer,krieger-od/gstreamer,cablelabs/gstreamer,collects/gstreamer,krieger-od/gstreamer,centricular/gstreamer,surround-io/gstreamer,collects/gstreamer,shelsonjava/gstreamer,StreamUtils/gstreamer,jpakkane/gstreamer,Lachann/gstreamer,StreamUtils/gstreamer,centricular/gstreamer,surround-io/gstreamer,jpakkane/gstreamer,krichter722/gstreamer,ensonic/gstreamer,jpxiong/gstreamer,StreamUtils/gstreamer,surround-io/gstreamer,cfoch/gstreamer,mparis/gstreamer,jpakkane/gstreamer,ensonic/gstreamer,shelsonjava/gstreamer,krichter722/gstreamer,justinjoy/gstreamer,Lachann/gstreamer,mparis/gstreamer,mparis/gstreamer