Initialize bytes_written in _handle_write()