GearSwap: Only call pet_status_change for valid pets.
Ensure pet.status is updated with the new status. It may not have been
updated via refresh_globals().
GearSwap: Revise pet refreshing to account for currently assigned isvalid state.
If the current pet table has a pet index matching the player's pet index, copy
the isvalid state from that rather than forcing it to be true.  This accounts
for when the pet is released and sets isvalid to false, another refresh event
occurs afterwards.  That way we're not left with an orphan 'valid' pet that
doesn't actually exist.