=per #15511 track number of unconfirmed messages in a var instead of iterate the map

I think the ```unconfirmed.size```may be a little over head,but current I don't have a benchmark for that,but the implement in the ```PersistentChannel``` just do it this way.