England led 24-8 but lost fifth match in succession before South Africans piled on points and hung on in the closing minutes