The tradeoff between information and pathogen transmission in animal societies