Fix SSH CLI when using custom "shell" option

Also address compatibility issue with PuTTY
Test Other Clauses of start_shell

start_shell() is called by exec, so test those cases as well.

Also add support for passing a fun to exec.
Merge branch 'michaelkschmidt/ssh_bug_fix' into maint

* michaelkschmidt/ssh_bug_fix:
  Test Other Clauses of start_shell
  Fix SSH CLI when using custom "shell" option