Fixes issue where dying pet can possibly crash server

When a bst pet dies the current pet ai gets deleted and replaced with a mob AI. Problem is the ai gets deleted in detachpet and then jumps back into the deleted pet ai. This will jump out of the pet ai early if its a mob pet.