Fix resource leak in InternalAttribute.setValue()