nditer: conditionalize GIL locking