lavc/mediacodec: do not delete a local reference twice in case of error