Single-strain behavior predicts responses to environmental pH and osmolality in the gut microbiota