v4l2videoenc: workaround for sink pool dequeue race condition

Sink pool dequeue and finish frame has race condition.
Unref input buffer in chain thread to avoid it.

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

UpStream Status: Pending

Signed-off-by: Song Bing<bing.song@nxp.com>
diff --git a/sys/v4l2/gstv4l2videoenc.c b/sys/v4l2/gstv4l2videoenc.c
index 44f1605..f0539c2 100644
--- a/sys/v4l2/gstv4l2videoenc.c
+++ b/sys/v4l2/gstv4l2videoenc.c
@@ -771,9 +771,10 @@
     }
   }
 
-  gst_video_codec_frame_unref (frame);
   gst_buffer_unref (frame->input_buffer);
   frame->input_buffer = NULL;
+  gst_video_codec_frame_unref (frame);
+
   return ret;
 
   /* ERRORS */