vd_lavc: flush frames before uninitializing hw decoder

This way, no surfaces are in use when uninitializing the hw decoders,
which might help with -copy hw decoders (normal hw decoding is not
affected).