A former specialist hospital which closed after an abuse scandal has had plans approved to turn it into flats by Durham County Council.