The US justice department has reached a financial settlement with Donald Trump's former national security adviser, Michael Flynn.