After a three-year investigation, the Justice Department said Thursday that it had reached a $2 billion settlement with Barclays, a giant British bank that federal prosecutors say sold toxic mortgages that contributed to the global financial crisis.Prosecutors say that between 2005 and 2007 Barclays sold investors packages of mortgages that were worth less than the bank claimed, costing the investors billions of dollars.