ts/udpsink: move sync on buffer to try_next
By moving sync on buffer ts to try_next
, the resulting delay
can be cancelled when a state transition occurs.
To prevent item loss, this requires first peeking the incoming
item from the channel without popping it. After the delay has
elasped, we can pop the item as the last await point in
try_next
: either it will be cancelled before popping or the
popped item will be passed on to handle_item
.
Also add flush
which was missing from stop
and flush_start
transition actions.