cashew: prevent nested byte counter deletion

When a byte counter is deleted, the byte counter makes a final stats
report to its delegate. It's possible for the callback handler for this
report to decide to delete the byte counter, causing a nested deletion.

Repro steps for this issue are to connect to 3G and then disable mobile
data from the internet settings page.

This CL prevents this nested deletion by changing
DataPlan::OnByteCounterUpdate not to stop the byte counter if there are
no active plans.

This CL also fixes some minor cpplint errors.

BUG=chromium-os:20144
TEST=unit tests and manual testing on device

Reviewed-on: http://gerrit.chromium.org/gerrit/10282
Tested-by: Vince Laviano <vlaviano@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Vince Laviano <vlaviano@chromium.org>
(cherry picked from commit d38e314992a263944b6016b788dfa19ddf1159fb)

Change-Id: Iedd82d4457bb53ff1d39a2a963822cae1346f846
Reviewed-on: http://gerrit.chromium.org/gerrit/10369
Commit-Ready: Vince Laviano <vlaviano@chromium.org>
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Vince Laviano <vlaviano@chromium.org>
6 files changed