cmdmod: should be `if`, not `elif`; CWD validity check shouldn't be Windows-only
Merge pull request #7166 from cvrebert/patch-1

cmdmod: `if`, not `elif`; CWD validity check shouldn't be Windows-only