Plans to convert a 16th-century North Yorkshire country house and former public school into luxury retirement apartments have been passed.