Deal extricates lender from one of the last businesses related to its ill-fated push into retail banking