Bank of America is nearing a deal with the Justice Department to pay out more than $16.5 billion, the largest mortgage fraud settlement in history, for misleading mortgage investors in the run-up to the financial crisis.