[serializer] Make snapshot()/revert() revert current object links Fixes https://github.com/harfbuzz/harfbuzz/issues/2325