buffer: Only set TAG_MEMORY if the memory has been replaced
Currently we set TAG_MEMORY as soon a resize changes the size of one of the memory. This has the side effect that buffer pool cannot know if the memory have simply been resized, or if the memorys has been replaced. This make it hard to actually implement _reset(). Instead, only set the TAG_MEMORY if one or more memory has been replaced, and do a light sanity check of the size. https://bugzilla.gnome.org/show_bug.cgi?id=727109