Home Depot’s latest results were better than expected despite supply-chain challenges that have disrupted many retailers.