Being around unhappy people is associated with poorer health and a shorter lifespan, according to a study conducted at Stanford University.