Fix for "env" param in cmd state/module (2014.1 branch)

This is #11422, cherrypicked for 2014.1.

@s0undt3ch should probably give this a look-over before it is merged, he was the one that wrote the saltenv stuff initially.