Activate and Reject: Towards Safe Domain Generalization under Category Shift