This is already handled in filter-exec-stdin, using IPC::Cmd, which may be what I should do here, but I guess this is ok.
This should be slightly more correct and doesn't result in an extra blank line.