- add safety parens to the MAX macros
- add frees to close memory leaks revealed by valgrind
  one of which fixes a small leak in master
- change key count and bytes count to 64bit (previously
  size_t, then uint32_t)