Speculative fix for hangs during Encoder::end().