Costco on Tuesday reported quarterly earnings that topped Wall Street’s expectations, as shoppers turned to the membership club for groceries but bought fewer big-ticket items.On an…