Fix program exiting before all threads are done

Haskell doesn’t wait for child threads to finish before terminating
the main thread, this has to be implemented manually.
See: http://hackage.haskell.org/package/base-4.7.0.1/docs/Control-Concurrent.html#g:12