The Corporation for Public Broadcasting on Thursday elected Donald E. Ledwig president and chief executive officer. Ledwig, 50, has been acting president since Martin Rubenstein resigned in November, 1986. Ledwig has been with CPB since November, 1984, when he was named vice president and treasurer. The board's vote was unanimous. Two seats on the 10-member board remain vacant. Last month, the Senate confirmed four nominees to the board of CPB.