The tail/consumer disconnection is quite problematic
because no message intended to be consumed by tail
can be left in the buffer because else i prevent
reuse of the buffer space.
The ul_cbuff_tail_detach_onestep() function returns
value 0 if there is no message left and tail is disconnected.
Value 1 indicates that at least one more iterations is required.
Value 2 is returned if there are partially filed messages
preventing immediate next step. Wait for consumer
wake event is required in this case.