Multithread stuff

stuff needed in opm-porsol to multithread cpchop.

also see https://github.com/OPM/opm-core/pull/409