[PATCH 5/6] ring-buffer: Restructure ring_buffer_wait() to prepare for updates