The number of U.S. representatives and senators who are leaving office or not running for re-election is nearing a record, and it could impact the midterms.