Fix regression in capturing agent output in execd.

Resulted from making CfReadLine dynamic. Close #4177