At least measure the ringbuffer size for JACK's latency

We should also add the port latency, but there's currently no way to ensure
it's synchronized with the ringbuffer (the ringbuffer will update before the
port latency gets updated).
Don't set unused pointers to NULL, don't try to write 0 samples
Add a lockless ringbuffer

Largely copied from JACK, it's extended to work with user-specified element
sizes instead of bytes. This is necessary to be able to work with 6- and 7-
channel output modes.
Use the custom ringbuffer instead of JACK's
Try the device-specified channel configuration first

This does basically no checking that the channel config is correct, but should
be good enough for when non-stereo modes are requested.