HSBC added almost $400m to its profits last year from settlements and provisions connected to legal matters, according to the bank’s latest annual report.