Adaptive evolution of stress response genes in parasites aligns with host niche diversity