Add shutdown method to shutdown the thread pool.

Fixes issue #3.