change monotonic_buffer_resource so that it no longer owns the initial buffer
fix undefined behaviour