osmo_io: Rewrite iofd_handle_send_completion() to fix multiple issues
Previous implementation had multiple issues, which this patch addresses: * Didn't call user cb updating completed bytes for a given msg which had a partial write. * rc checks against "Incomplete write" were wrong, because rc was not being decremented with previous msgs idxs being processed. * Didn't take into account the write(0, fd, buf) = 0 valid user case for regular files.
The rewrite also simplifies the logic by splitting the "rc < 0" (error) paths from the "rc >= 0" (successful) paths.
osmo_io: Fix msgb memleak if iofd is unregistered during write_cb with >1 io buffers
The msgbs are not allocated under the msghdr, hence if user unregistered the iofd we need to manually free all remaining msgbs when freeing the msghdr.