Two of the largest U.S. pharmacy chains, CVS Health and Walgreen Co., announced agreements in principle Wednesday to pay about $5 billion each to settle lawsuits nationwide over the toll of opioids, and a lawyer said Walmart is in discussions for a deal.