Ted Danson plays a retired professor-turned-undercover agent in this amiable, bittersweet show