Sociality and Stress Adaptation by a Microbial Collective