Switch BeamPacketizer unflushedMessageCount to an AtomicInteger.