Fix the joining of threads

threads is an array, so threads.join was not doing what it was supposed to.
which is threads.each {|thr| thr.join}