David Gates, Scots headmaster, appointed to top job when schools integrate