Small fixes to make VAAPI encoding reliable