Ensure that the 'id' grain available to pillar is valid

Refs changes in #11965