Stock Exchange legal head quits