Yanks walk off, Sox clinch last place