vaapivideomemory: refactor vaapi memory mapping
vaapivideomemory: refactor vaapi memory mapping

There were duplicated code in gst_video_meta_map_vaapi_memory() and
gst_vaapi_video_memory_map() when doing the READ and WRITE mapping.

This patch refactors both methods adding the common function
map_vaapi_memory().

Additionally, only when flag has the READ bit it calls
ensure_images_is_current(), which was done in
gst_video_meta_map_vaapi_memory() but no in
gst_vaapi_video_memory_map().

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

GStreamer/gstreamer-vaapi,GStreamer/gstreamer-vaapi,ceyusa/gstreamer-vaapi,ceyusa/gstreamer-vaapi