A psychologist explains why losing a dog can be as painful as losing a relative