Nike posted surprise sales growth and beat on earnings even as it faced higher tariffs and tried to execute a turnaround plan.