1. Terrorists will not be the first to create an AGI/ASI.
2. Terrorists always have an agenda, usually to disrupt or destroy their enemies, but I don't think any terrorist group want the obliteration of Earth which obviously also means their obliteration. Maybe some psychopaths want that, but they're not going to develop the first AGI.
While I agree it definitely is not a likely outcome, there is still the possibility. That isn't the point though as it was just an example, there are many other situations where ASI can have a goal that it would eventually complete. My guess is that the brilliant people who create AGI are going to be smart enough to come up with most things we discussed here on their own and decide it would be better off making sure it's goal isn't anything like this. But who knows they may decide to experiment and do just that so they can see what would happen.