title: PhantomJS crashes after phantom.exit() on Linux
body: <p>I've tried to build a very simple solution on top of PhantomJS, but somehow it crashes when calling <code>phantom.exit()</code>. For example, when running the following code:</p>
  
  <pre><code>var page = require('webpage').create();
  page.onResourceRequested = function (request) {
      console.log('Request ' + request.url);
      phantom.exit();
  };
  page.open('http://www.google.com/');
  </code></pre>
  
  <p>crashes with segmentation fault on Ubuntu (12.04.3 LTS) and CentOS (6.4). If I comment out <code>phantom.exit()</code> it lists requested URLs, so it basically works as expected. However <code>phantom.exit()</code> is something I really need, as I would like to terminate my script in certain cases (eg. attempt to access specific domain). 
  I have a feeling that my issue is too obvious, but haven't a clue of what's going on.</p>