ring-buffer: Protect ring_buffer_reset() from reentrancy