Affection from a dog really is medicinal, according to a new study