vaapi_encode: Respect driver quirks around buffer destruction

No longer leaks memory when used with a driver with the "render does
not destroy param buffers" quirk (i.e. Intel i965).

(cherry picked from commit 221ffca6314ed3ba9d38464ea50cd85251c04e74)
Fixes ticket #5871.
