Fixed creating new threads on and on

There was a major bug which caused the plugin to spawn new threads on and on until no threads were available anymore.
Merge pull request #64 from SvStefan/patch-1

Fixed creating new threads on and on