Added some extra debug_asserts to ring_buf.