Kroger will buy Giant Eagle in a $1.65 billion deal to expand its supermarket and pharmacy footprint after its failed merger with Albertsons.