Let the queue of URIs to process be a queue of Maybe URI

The plan is to use Nothing to indicate that the worker thread may
terminate.
Rewrote threading to use STM and detect end of input correctly

All worker threads now keep track of how many other workers are
still busy. If a thread, after processing some item from the
queue, notices that the queue is empty and no other worker
is busy it will post a 'poison pill' to the queue: Nothing.

This element will be read by all other threads, and it will make
them terminate.

This required using TChan instead of Chan since Chan has some
known deadlocks in isEmptyChan.
Use sequence_ instead of _ <- sequence for cosmetic reasons
Implemented a whole bunch of hlint suggestions