Adopting a dog could lengthen your life, study says