Blocks until threads have joined