Walmart said it will stop selling firearms and ammunition to people under 21, following in the footsteps of sporting retailer Dick's Sporting Goods.