Issue 32 memory leak

This pull request contains the fix for [memory leak](https://github.com/rainu/jsimpleshell/issues/32). And it make the integrationstests more stable.