fan-in: fix nil put on out channel, deadlock

- if one of the input channels is closed, fan-in would try to put a nil
  on the output channel