Airbus has been forced to write-off billions of dollars as it struggles to get its beleaguered A400M military plane back on track.