title: Issues running popen() from Wt widget signal event
body: <p>I'm trying to integrate a firmware upgrade functionality inside a Witty application.</p>
  
  <p>The application communicate with an external device by using <code>/dev/ttyUSB0</code>, the same port is used for firmware upgrade, when doing so, the application release the port and call an external command line application via <code>popen()</code>.</p>
  
  <p>The main issue is that it is perfectly working when executed in the main, but it is not when executed from an event example :</p>
  
  <pre><code>m_pUploadButton-&gt;clicked().connect(std::bind([=] () {
                  pComputer-&gt;firmwareUpgrade();
              }));
  </code></pre>
  
  <p>Here are the definitions of relevant functions :</p>
  
  <pre><code>bool ComputerV2::upgradeFirmware()
  {
      m_oMutex.lock();
  
      std::string sFile = "/home/alextown/MPLABXProjects/ordinateur_V2/dist/default/production/ordinateur_V2.production.hex";
  
      std::string sResult = "";
      std::string sCommand = "/home/alextown/QtProjects/build-pic32ubl-qt-qt5-Release/pic32ubl-qt --headless --port=/dev/" + m_sPort + " --file=" + sFile + " --erase --program --verify --jump-application";
  
      std::cout &lt;&lt; sCommand &lt;&lt; std::endl;
  
      int nResult = exec(sCommand,sResult);
  
      std::cout &lt;&lt; sResult &lt;&lt; std::endl;
  
      m_oMutex.unlock();
  
      return nResult == 0;
  }
  
  int exec(std::string p_sCommand, std::string &amp;p_sResult)
  {
      FILE *pipe = popen(p_sCommand.c_str(),"r");
  
      p_sResult = "";
  
      if(!pipe) return -1;
  
      char buffer[128];
  
      while(!feof(pipe))
      {
          if(fgets(buffer,128,pipe) != NULL)
          {
              p_sResult += buffer;
          }
      }
  
      return pclose(pipe);
  }
  </code></pre>
  
  <p>From what I've observed, when running upgrade from <code>main</code>, everything works perfectly (jump device in upgrade mode, upgrade and jump back in normal mode). When running from widget, data sent over the port <code>/dev/ttyUSB0</code> is not the same, thus causing communication issue and upgrade failed.</p>
  
  <p>From my comprehension, there is something different in thread ran for Witty widgets than thread ran for main application.</p>