lib/process: Add option to pipe to process stdin