Avoid a memory leak when deserializing variables of type Buffer