[DWRF] Check memory on each row

Summary:
@public
One major source of OOM's is that we only check the memory usage once every 5000 rows.

The reason we check so infrequently is because to determine the amount of memory we're using requires an expensive traversal of the tree of writers.

I changed it so that as we use more memory we increment a counter, so that checking the memory usage is as cheap as checking the value of that counter.  This makes it so we can afford to check it on every row with minimal performance consequences.

This should help to significantly reduce the number of OOM's.

Test Plan:
The current testcases verify that memory is still being calculated appropriately, that stripes are getting flushed when they should be, and the MemoryManager is still performing as expected.

I also verified that at the 5000 row mark where we used to check memory, in each of the test cases the memory counters we're using now match the value we had before (accounting for a few of the changes I made in calculating memory).

Reviewers: tejasp

Reviewed By: tejasp

Differential Revision: https://phabricator.fb.com/D1476964