sys: lib: ringbuffer: introduce ringbuffer_get_free

This function returns the number of bytes available in the ringbuffer.

Basically a getter for rb->avail.