Writes all bytes in data to the L2CAP channel and flushes it.
if writing to the channel fails.
if the coroutine is cancelled.