Fix gating bug
Fix gating bug

We need to distinguish between the case of a gated process that
already has all its input (and thus the producer is NULL) and
the case that the gated process hasn't been inserted into a
pipeline (and thus the producer is the same as the process,
but before producer used to be NULL in this case, too).

damelang/nile,damelang/nile,damelang/nile,damelang/nile,damelang/nile,damelang/nile