Merge "Fix a crash where the EOS was signalled but some output buffer were still pending."