Right now we only delete templates and related data when an Activity Log Rules action is deleted, and not when an entire Rule is deleted. This isn't a big deal as most of Activity Log's template-related data is just a cache of what's stored in Rules anyway, and will be cleared the next time the "Clear all message caches" button is clicked, but even though the extra data doesn't affect anything we should still keep the DB clean.