queue2: fix possible data corruption in ring buffer mode when seeking
queue2: fix possible data corruption in ring buffer mode when seeking

Fix race that could cause data corruption when seeking in ring buffer
mode.

In perform_seek_to_offset(), called from the demuxer's pull_range
request, we drop the lock, tell upstream (usually a http source)
to seek to a different offset, then re-acquire the lock before we
do things to the ranges. However, between us sending the seek event
and re-acquiring the lock, the source thread might already have pushed
some data and moved along the range's writing_pos beyond the seek
offset. In that case we don't want to set the writing position back
to the requested seek position, as it would cause data to be written
to the wrong offset in the file or ring buffer.

Reproducible doing seek-emulated fast-forward/backward on 006653.

Conflicts:
	plugins/elements/gstqueue2.c

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