Fix exception when compound matching grains

Inject the grains dictionary into __opts__ before proceeding. Refs #7944.
Merge pull request #8304 from cachedout/#7944

Fix exception when compound matching grains