[logdog] Fix the expired stream is not drained when flushing
[logdog] Fix the expired stream is not drained when flushing

The issue is that when bundler is flushing, it checks whether the stream
snapshot is empty to decide whether flushing is done. However, the
absence of a stream in the stream snapshot does not indicate that this
stream has been drained after change: http://crrev.com/c/2176410 .
Instead, we should look at the stream registry in bundler. This change
also makes sure if a stream is drained, it will be unregistered from the
bundler.

Failed build: https://ci.chromium.org/p/infra-internal/builders/prod/git-cache-chromium-host/b8881298048127898592

R=iannucci

Bug: 1077149
Change-Id: Ib52f4bd176e5e278e85e12aa94bcd3b39cabf2e9
Reviewed-on: https://chromium-review.googlesource.com/c/infra/luci/luci-go/+/2180530
Auto-Submit: Yiwei Zhang <50b2a565e2e78c292794832469a30ce5abc9959c@google.com>
Commit-Queue: Robbie Iannucci <40f3d43a28ebae3cb819288542e1c84d73d962d5@chromium.org>
Reviewed-by: Robbie Iannucci <40f3d43a28ebae3cb819288542e1c84d73d962d5@chromium.org>

luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go