libubus: detect read/write errors and set the eof flag, even if uloop is not used...