avcodec/error_resilience: factor er_supported() check out

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/error_resilience: check that er is supported before attempting to read the status of the previous slice

Fixes incorrectly set error_occured and improves speed

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>