Avoiding thermal runaway in lithium-ion batteries using ultrasound detection of early failure mechanisms