Looking at the big picture, you may want to reconsider working with domains rather than usernames. Here's a few scenarios you need to be mindful of when dealing with domains:
- People can have multiple domains on a single account
- It's common for someone to unpark a domain, change the primary domain associated with an account and park the old primary domain on that same account after swapping primary domains.
Admittedly, usernames can change too, but it's more common to change domains than change usernames.
However, if you still want to go by domain name, I recommend using prekillacct instead of postkillacct. This will execute when the account still exists (but is in the process of being terminated) so you can still cross reference domains with usernames by other means (e.g. using the XML API to gather this information, though there is very likely to be alternatives that are equally reliable).