Fall back to av_free if avcodec_free_frame does not exist.