Merge pull request #568 from howbazaar/fix-envcmd-ensure

Backport from trunk

Envcmd is more forgiving during init.

Don't error in envcmd if we can't work out the environment until we actually need it.