The deal clears up a major source of uncertainty at the banking giant and is likely to lead the way for similar settlements between Fannie and other big mortgage originators.