ring-buffer: add reader lock