European Central Bank President Christine Lagarde will finish her term nine months early, announcing her departure at a challenging time for the bank.