[RFC] Fix some unchecked returns for Coverity

Just a few Coverity fixes to reduce the count on the defects so the more important ones can be handled.
Another tricky case: `autowrite` may fail due to an error from `buf_write_all` or a "conversion error" (seems to be a rare case).