Fix force-flush logic to flush *before* we get too big

The old logic would force a flush the message *after* we exceeded the threshold,
which would be rather silly since it's too late at that point.