Goldman Sachs to pay $5B mortgage settlement