ring-buffer: Fix race between integrity check and readers