Fix `pool.map` so that order of results is retained

There is no guarantee in which order the threads will complete their task, so the map jobs must know the index their result should have in the final results list.

Also fixed the tests so that nosetests doesn't hang on a test failure (pool not properly shutdown)