Fix some bugs in duration tracker.

There are some bugs in the previous big anomaly detection cl, which I didn't catch.

Test: statsd_test
Change-Id: I2ca22e0f112e5cff8fb204c0c94141188659fdba
5 files changed