CHICAGO—President Barack Obama has bid farewell to the nation in an emotional speech that sought to comfort a country on …