fix calculation of ready_cnt

in case multiple messages from the same broker are processed,
ready_cnt is increased multiple times.