Fix netusage underflow due to race condition.

Also add a unit test.

Change-Id: Ia00df67444f3dcf8dc0de4c3ff131872bea8deef
3 files changed