Barclays has been hit with a £40 million fine after abandoning a court battle with the UK’s financial watchdog over deals struck with Qatari investors during the 2008 financial crisis.