fixed SIGPIPE bugs (edited rio_read, rio_write), some more error reporting