Which battle convinced the british that the war was too costly and marked the end of the american revolution?.