Move structures into (private) part of buffers.h so we can inspect them while testing
More unit tests for #11648-related stuff

These are actually tests for #311.  It appears to me that we didn't
fix #311 properly when we thought we did in 475eb5d6; instead, the
real fix was 05eff35ac6d64b, a few minutes earlier.
Fix test_util_max_mem on 32-bit CPUs