Tim Davie has announced he will step down as director-general of the BBC after five years in the role, saying there have "been some mistakes made" and that he had to "take ultimate responsibility".