Fix rare deadlock before loop filter
Fix rare deadlock before loop filter

There was an extremely rare deadlock that happened when one thread
was waiting to start the loop filter on frame n while the other
threads were starting to work on frame n+1.

Change-Id: Icc94f728b3b6663405435640d9a2996735ba19ef

webmproject/libvpx,kim42083/webm.libvpx,Suvarna1488/webm.libvpx,iniwf/webm.libvpx,luctrudeau/aom,shyamalschandra/libvpx,luctrudeau/aom,mbebenita/aom,lyx2014/libvpx_c,running770/libvpx,shyamalschandra/libvpx,pcwalton/libvpx,ittiamvpx/libvpx-1,running770/libvpx,genesi/libvpx0,matanbs/vp982,vasilvv/esvp8,hsueceumd/test_hui,mbebenita/aom,turbulenz/libvpx,luctrudeau/aom,zofuthan/libvpx,reimaginemedia/webm.libvpx,matanbs/webm.libvpx,matanbs/webm.libvpx,altogother/webm.libvpx,mbebenita/aom,rikaunite/gst-opera_libvpx,goodleixiao/vpx,stewnorriss/libvpx,ittiamvpx/libvpx-1,thdav/aom,kleopatra999/webm.libvpx,jmvalin/aom,rikaunite/gst-opera_libvpx,VTCSecureLLC/libvpx,liqianggao/libvpx,Laknot/libvpx,reimaginemedia/webm.libvpx,felipebetancur/libvpx,vasilvv/esvp8,Maria1099/webm.libvpx,webmproject/libvpx,hsueceumd/test_hui,rikaunite/gst-opera_libvpx,shyamalschandra/libvpx,smarter/aom,matanbs/webm.libvpx,Topopiccione/libvpx,shareefalis/libvpx,shyamalschandra/libvpx,VTCSecureLLC/libvpx,reimaginemedia/webm.libvpx,vasilvv/esvp8,abwiz0086/webm.libvpx,ShiftMediaProject/libvpx,liqianggao/libvpx,jmvalin/aom,shareefalis/libvpx,jmvalin/aom,jmvalin/aom,charup/https---github.com-webmproject-libvpx-,turbulenz/libvpx,luctrudeau/aom,zofuthan/libvpx,ShiftMediaProject/libvpx,iniwf/webm.libvpx,pcwalton/libvpx,mbebenita/aom,shacklettbp/aom,iniwf/webm.libvpx,goodleixiao/vpx,kalli123/webm.libvpx,webmproject/libvpx,cinema6/libvpx,WebRTC-Labs/libvpx,awatry/libvpx.opencl,shacklettbp/aom,smarter/aom,WebRTC-Labs/libvpx,vasilvv/esvp8,stewnorriss/libvpx,cinema6/libvpx,enmasse-entertainment/libvpx,WebRTC-Labs/libvpx,thdav/aom,jdm/libvpx,sanyaade-teachings/libvpx,cinema6/libvpx,GrokImageCompression/aom,mwgoldsmith/libvpx,n4t/libvpx,gshORTON/webm.libvpx,VTCSecureLLC/libvpx,vasilvv/esvp8,VTCSecureLLC/libvpx,abwiz0086/webm.libvpx,matanbs/vp982,Laknot/libvpx,mwgoldsmith/libvpx,jdm/libvpx,n4t/libvpx,jdm/libvpx,mwgoldsmith/libvpx,Topopiccione/libvpx,jacklicn/webm.libvpx,Laknot/libvpx,Suvarna1488/webm.libvpx,jacklicn/webm.libvpx,openpeer/libvpx_new,hsueceumd/test_hui,enmasse-entertainment/libvpx,mwgoldsmith/vpx,lyx2014/libvpx_c,mwgoldsmith/vpx,gshORTON/webm.libvpx,lyx2014/libvpx_c,goodleixiao/vpx,matanbs/vp982,mwgoldsmith/vpx,pcwalton/libvpx,n4t/libvpx,kalli123/webm.libvpx,altogother/webm.libvpx,genesi/libvpx0,Topopiccione/libvpx,goodleixiao/vpx,altogother/webm.libvpx,running770/libvpx,shacklettbp/aom,webmproject/libvpx,shacklettbp/aom,Distrotech/libvpx,running770/libvpx,goodleixiao/vpx,Acidburn0zzz/webm.libvpx,running770/libvpx,turbulenz/libvpx,lyx2014/libvpx_c,zofuthan/libvpx,iniwf/webm.libvpx,openpeer/libvpx_new,felipebetancur/libvpx,hsueceumd/test_hui,kalli123/webm.libvpx,Laknot/libvpx,smarter/aom,matanbs/vp982,lyx2014/libvpx_c,Maria1099/webm.libvpx,stewnorriss/libvpx,openpeer/libvpx_new,enmasse-entertainment/libvpx,lyx2014/libvpx_c,jacklicn/webm.libvpx,charup/https---github.com-webmproject-libvpx-,Suvarna1488/webm.libvpx,thdav/aom,ShiftMediaProject/libvpx,thdav/aom,Acidburn0zzz/webm.libvpx,n4t/libvpx,kalli123/webm.libvpx,iniwf/webm.libvpx,pcwalton/libvpx,Maria1099/webm.libvpx,webmproject/libvpx,awatry/libvpx.opencl,ittiamvpx/libvpx-1,abwiz0086/webm.libvpx,matanbs/vp982,genesi/libvpx0,kalli123/webm.libvpx,Suvarna1488/webm.libvpx,liqianggao/libvpx,jmvalin/aom,Acidburn0zzz/webm.libvpx,GrokImageCompression/aom,zofuthan/libvpx,zofuthan/libvpx,mbebenita/aom,shyamalschandra/libvpx,Acidburn0zzz/webm.libvpx,ittiamvpx/libvpx,kim42083/webm.libvpx,VTCSecureLLC/libvpx,gshORTON/webm.libvpx,Laknot/libvpx,Distrotech/libvpx,Maria1099/webm.libvpx,VTCSecureLLC/libvpx,thdav/aom,pcwalton/libvpx,altogother/webm.libvpx,shacklettbp/aom,felipebetancur/libvpx,Suvarna1488/webm.libvpx,ittiamvpx/libvpx-1,enmasse-entertainment/libvpx,openpeer/libvpx_new,ittiamvpx/libvpx-1,felipebetancur/libvpx,shareefalis/libvpx,vasilvv/esvp8,abwiz0086/webm.libvpx,cinema6/libvpx,goodleixiao/vpx,mbebenita/aom,sanyaade-teachings/libvpx,Maria1099/webm.libvpx,Topopiccione/libvpx,Topopiccione/libvpx,kalli123/webm.libvpx,hsueceumd/test_hui,turbulenz/libvpx,cinema6/libvpx,matanbs/webm.libvpx,genesi/libvpx0,enmasse-entertainment/libvpx,matanbs/vp982,kim42083/webm.libvpx,WebRTC-Labs/libvpx,turbulenz/libvpx,mwgoldsmith/vpx,matanbs/webm.libvpx,jdm/libvpx,Distrotech/libvpx,cinema6/libvpx,jdm/libvpx,kim42083/webm.libvpx,mbebenita/aom,kleopatra999/webm.libvpx,awatry/libvpx.opencl,gshORTON/webm.libvpx,jacklicn/webm.libvpx,ShiftMediaProject/libvpx,kleopatra999/webm.libvpx,vasilvv/esvp8,shareefalis/libvpx,rikaunite/gst-opera_libvpx,stewnorriss/libvpx,gshORTON/webm.libvpx,hsueceumd/test_hui,ittiamvpx/libvpx-1,turbulenz/libvpx,GrokImageCompression/aom,GrokImageCompression/aom,turbulenz/libvpx,thdav/aom,ittiamvpx/libvpx,openpeer/libvpx_new,smarter/aom,smarter/aom,cinema6/libvpx,openpeer/libvpx_new,matanbs/webm.libvpx,genesi/libvpx0,genesi/libvpx0,mwgoldsmith/libvpx,jacklicn/webm.libvpx,luctrudeau/aom,stewnorriss/libvpx,Topopiccione/libvpx,Distrotech/libvpx,stewnorriss/libvpx,Acidburn0zzz/webm.libvpx,kim42083/webm.libvpx,jmvalin/aom,smarter/aom,Laknot/libvpx,Suvarna1488/webm.libvpx,mwgoldsmith/libvpx,n4t/libvpx,jacklicn/webm.libvpx,ShiftMediaProject/libvpx,liqianggao/libvpx,sanyaade-teachings/libvpx,kleopatra999/webm.libvpx,WebRTC-Labs/libvpx,pcwalton/libvpx,mbebenita/aom,reimaginemedia/webm.libvpx,mwgoldsmith/libvpx,abwiz0086/webm.libvpx,rikaunite/gst-opera_libvpx,altogother/webm.libvpx,kleopatra999/webm.libvpx,running770/libvpx,shyamalschandra/libvpx,charup/https---github.com-webmproject-libvpx-,Maria1099/webm.libvpx,shareefalis/libvpx,mbebenita/aom,ittiamvpx/libvpx,kleopatra999/webm.libvpx,felipebetancur/libvpx,abwiz0086/webm.libvpx,mwgoldsmith/vpx,charup/https---github.com-webmproject-libvpx-,sanyaade-teachings/libvpx,gshORTON/webm.libvpx,altogother/webm.libvpx,charup/https---github.com-webmproject-libvpx-,Distrotech/libvpx,liqianggao/libvpx,turbulenz/libvpx,kim42083/webm.libvpx,awatry/libvpx.opencl,GrokImageCompression/aom,felipebetancur/libvpx,zofuthan/libvpx,turbulenz/libvpx,liqianggao/libvpx,ittiamvpx/libvpx,ittiamvpx/libvpx,sanyaade-teachings/libvpx,jdm/libvpx,shacklettbp/aom,Distrotech/libvpx,ittiamvpx/libvpx,iniwf/webm.libvpx,mwgoldsmith/vpx,shareefalis/libvpx,charup/https---github.com-webmproject-libvpx-,reimaginemedia/webm.libvpx,webmproject/libvpx,Acidburn0zzz/webm.libvpx,GrokImageCompression/aom,matanbs/vp982,luctrudeau/aom,reimaginemedia/webm.libvpx