Simplify: convert basic.credit_state to basic.credit_drained, which implicitly asserts that credit is 0, length 0 and drain is true, and tells you how much credit was discarded rather than the new delivery count (so we can soon remove all delivery count code from the broker).