Fix DxVA2 crash on Error path

Close #9500 and #9665

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>