A North Yorkshire village pub once visited by Princes William and Harry has closed.