libs: encoder: refactor to avoid code duplication

gst_vaapi_encoder_put_frame() and gst_vaapi_encoder_flush() duplicates
the same code segment where the coded buffer is created, the picture
encoded on it and pushed to the async queue.

The function gst_vaapi_encoder_encode_and_queue() refactor this.
8 jobs for loseframe in 25 minutes and 30 seconds (queued for 34 seconds)
Status Job ID Name Coverage
  Preparation
passed #80729
gst indent

00:00:19

passed #80728
manifest

00:00:38

 
  Build
passed #80730
build fedora x86_64

00:03:22

 
  Test
passed #80731
check fedora

00:07:37

 
  Full Builds
passed #80732
build android arm64 api28

00:03:11

passed #80734
build cerbero cross win32

00:12:02

passed #80735
build cerbero cross win64

00:13:23

passed #80733
build cerbero fedora x86_64

00:07:42