Fixed multithreading on Windows

Now threads are waiting on a queue instead of a thread join() loop that appeared to be glitchy.