Gilling Castle in North Yorkshire - a country house and former public school - is set to be converted into luxury retirement apartments.