Morgan Stanley struck a deal to buy a fintech to bring a key technical aspect of handling corporate stock plans in house, further beefing up the bank’s massive wealth-management arm.