US warehouse retailer Costco has booked a rise in profits thanks to inflation in gasoline prices and strengthening foreign currencies.