Patch to fix auras killing pets from causing a core dump

This is a patch that was suggested by Rochet2 but never tested or worked. I changed it a bit so it would work correctly and it has solved auras killing pets causing core dumps on my end in Debian GNU/Linux. If you have questions, ask.