title: com.jcraft.jsch.JSchException: channel is not opened when opening a channel in jsch
body: <p>When connecting to a remote host using jsch version 0.1.51 we occasionally run into the following exception when calling <code>Channel.connect()</code> on a <code>ChannelExec</code>.</p>
  
  <pre><code>com.jcraft.jsch.JSchException: channel is not opened.
      at com.jcraft.jsch.Channel.sendChannelOpen(Channel.java:765)
      at com.jcraft.jsch.Channel.connect(Channel.java:151)
      at com.jcraft.jsch.Channel.connect(Channel.java:145)
  </code></pre>
  
  <p>The code we use after the session has been created is:</p>
  
  <pre><code>ChannelExec channel = (ChannelExec) session.openChannel("exec");
  channel.setCommand("echo hello");
  channel.connect(); // Error here
  </code></pre>
  
  <p>The <code>Channel.connect()</code> call usually returns in under 100 ms, but when this error ocurrs the call hangs for more than 20 seconds before throwing the exception.</p>