Convert RINGBUF_* macros to inline functions, saving binsize and improving type safety.