atomicqueue: fix subtle race
atomicqueue: fix subtle race

Fix a race where the reader would see the updated the tail pointer before the
write could write the data into the queue. Fix this by having a separate reader
tail pointer that is only incremented after the writer wrote the data.

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