plugins: encode: unlock the stream lock before _flush()
The current encoder will hang when EOS comes. When we call the gst_vaapi_encoder_encode_and_queue(), we should release the stream lock, just like what we do in gst_vaapiencode_handle_frame().
The deadlock happens when: The input thread holding the stream lock is using gst_vaapi_encoder_create_coded_buffer() to acquire a coded buffer, while the output thread which holding the coded buffer resource is acquiring the stream lock in _push_frame() to push the data to down stream element.