avcodec/pthread_frame: check avctx on deallocation