Improve VA API buffers allocation logic. This also reduces struct vaapi_context