Walmart stock got a boost from an unlikely source. Wealthier households are spending more at the discount retailer.