Walmart is offering same-day pharmacy delivery nationwide amid intensifying competition from Amazon and the struggles of corner drugstores run by CVS and Walgreens.