The BBC's director general Tim Davie and head of news Deborah Turness have resigned after criticism that a Panorama documentary misled viewers by editing a speech by Donald Trump.