If the pet always has the same name, you could probably make a script for it and put it in the /quests/templates folder to be used in all zones. Something pretty basic should work.
Code:
sub EVENT_COMBAT {
if ($combat_state == 0) {
quest::depop();
}
}
That might work, but I didn't really test it at all. I am sure you could do some other checks like sub EVENT_NPC_SLAY or have it run a check to see if it has a target and once it looses that target, it depops.