The chairman of the Office for Budget Responsibility (OBR) has resigned after an investigation into the leak of last week's budget criticised the watchdog's leadership.