Fix a fairly major memory leak caused by pthreads being joinable by default and us not joining them. Now our threads are detached as we want.