The sale of GreenSky to a group of investors marks a critical step in the Wall Street bank’s retreat from consumer lending.