How close South Korea came to losing the war