Makes joblib's iterable threadsafe

If two threads call the iterable at the exact same time, a ValueError is thrown, so it uses a lock to make it threadsafe.