After posting solid first-quarter sales, Walmart warned that it may have to raise prices because of higher costs from tariffs implemented by President Donald Trump.