exec_cgi: make output compatible with IO.copy_stream