sys: lib: ringbuffer: introduce ringbuffer_get_free

This function returns the number of bytes available in the ringbuffer.