ringbuffer: add `ringbuffer_allocate()`

It might be useful to allocate memory in a ringbuffer before you got the
actual data, e.g. you know the size of an incoming IP packet before you
got the full packet.