s3: in sys_popen(), improve call to pipe and report error to debug