Barclays has been fined £40m over capital raising that averted its need for taxpayer aid during the 2008 financial crisis.