Make the shell process's exit code available to the main app so that
actions can be taken depending on whether the shell command was
successful or not.
Later work will build on this so that failed commands will result in
tabs being left open when the shell command fails. This will help when
troubleshooting incorrectly configured profiles, SSH connection issues
etc.
Exit codes are passed up for both WinPty and ConPty based terminals.