Rudimentary boundary checks in shared_buffer_t (in debug mode only)