Fixing disposal of threads

It was a lack of foresight to require threads to be disposed from the
main thread since it requires the event loop to have returned, but the
event loop can't return until all threads are disposed.