Fixes bug

If multiprocessing engine is initialized many times it can cause an error, e.g., OSError: [Errno 24] Too many open files
we need to terminate the pool when we del or a function is done running because python doesn't.