This allows av_mediacodec_release_buffer to be called safely after the decoder is closed, this was already the case with delay_flush=1. Note that this causes holding onto frames to keep the decoding context alive which is generally considered to be the intended behavior (resending as my patch got mangled somehow)