A controversial supermarket in a Yorkshire village which faced the threat of being knocked down before ever opening has been reprieved by council planners.