Force use of a known working shell

This solves problems with running commands as users with an invalid or
odd shell such as /bin/false
Merge pull request #4141 from wichert/cmd-enforce-working-shell

cmd: force use of a known working shell.