ca_ringbuffer: remove implementation based on AVFifoBuffer

I stole some good ideas from ao_portaudio's ringbuffer and went from there.
The main difference is this one stores wpos and rpos which are absolute
positions in an "infinite" buffer. To find the actual position for writing /
reading just apply modulo size.

The producer only modifies wpos while the consumer only modifies rpos. This
should help with what I want to do next: remove the threads and enforce
lockless thread safety in the SPSC case using atomic types and memory barries
to avoid reordering by the compiler and/or hardware.
ca_ringbuffer: move to core and rename to mp_ringbuffer

The idea is to consistently use this across all the subsystems that need a
ringbuffer to avoid duplication and solving the same problem over and over
again.
mp_ringbuffer: remove audio specific functionality

Only constructors are left alone. The rest was pretty stupid anyway.
mp_ringbuffer: use memory barriers instead of locks

This ringbuffer implementation is thread unless the operations are reordered
by the CPU/compiler. Make it so that all memory operations are commited before
updating the position indexes within the ringbuffer.
mp_ringbuffer: use av_malloc for internal buffer