changed the API a bit to simplify writing long data which doesn't fit in the buffer

and requires the use of a mux_output callback, which now provides the data
instead of having to call iomux_write() itself