Walmart earnings show its focus on margins pays off as Amazon rises