Probing the failure mechanism of nanoscale LiFePO4 for Li-ion batteries