Critical fix so threads are created as detached

Otherwise `sunDemo` will be unable to create more than ~340 threads in total because the resources are not freed.

Merging immediately