Realistically this seems like a really specific issue to have, would probably be better to include this as an option on the rebuild thread job or something similar. Assuming add-ons use the attachment handler (which they should 100% of the time) this is a non issue and will never happen, the issue only comes into play when something improperly inserts or removes data from attachment tables