Optimize flowtable iteration

Reviewer: trivial

These small changes help us iterate over the entire flowtable more efficiently. With these changes the CPU time used to get aggregate stats on 100000 flows is reduced 45%.