How a bad trade pushed a US mortgage giant into a $2bn lifeline