Costco Wholesale beat estimates for holiday-quarter sales and profit and said it would cut prices if it received any tariff refunds.