Bug 1034490: Optimize saveStats function of NetworkStatsDB.