Add btree max_cache_megabytes function. Initial test cases crashed because of inadvertent precondition violation, so add BOOST_ASSERTs to detect precondition violations. Also initialize some uninitialized buffer_manager variables to make debugging easier.