Flush picture buffers when closing the avcodec decoder.