Having pets in the house during a baby's first year was associated with a lower risk for allergies through the child's teens. Katherine Harmon reports