Related to #372. Fixes crash on systems where the stack size for new threads is to small