Rework the buffering logic
Rework the buffering logic

Reduce the code complexity of non-blocking IO all together. Besides, we
should let recording direction driving the playback direction if we are
working with duplex stream.

- Fix misuse of SNDCTL_DSP_GETOSPACE ioctl on record.fd as well

- Add more comments regarding buffer initialization

- Address comments about which direction driving another direction

kinetiknz/cubeb,kinetiknz/cubeb,kinetiknz/cubeb