add support for setting algorithm/nfactor for each pool separately, and ...

...fix bugged OpenCL thread cleanup (thread shutdown)