This smart dog waited for a person to cross the street and tucked in close to their heels