Yes. i admit it shouldn't be a perfomance problem and it's quite uncommon uncase but... 
How about this solution. 
Two lines above of the added line we are already calling 
```php
$objectAttribute->removeThis( $objectAttribute->attribute( 'id' ) );
```
right?

That leads us to https://github.com/ezsystems/ezpublish-legacy/blob/ezp-22923-delete_attribute_links/kernel/classes/ezcontentobjectattribute.php#L902

so, couldn't we add just add the deleteStoredObjectAttribute to the objectrelation and objectrelationlist datatypes?