ringbuffer: fix parameter types

It is a bad idea to use signed types for lengths.
Mark pointers a `restrict`, since the ringbuffer is not thread safe
anyway.
ringbuffer: remove pointer to the end

There is no need for an explicit pointer to the end of the buffer.
ringbuffer: don't overwrite in `ringbuffer_add`