ringbuffer: add convenience functions

This patch add `peek` functionality, and empty and full helpers.
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`