Move the AX resampling code to Common.

This will allow other parts of the code to reuse the generic resampling
code I implemented for the AX UCode. For example, the AudioCommon Mixer
currently implements linear interpolation on its own... badly (no support
for storing the previous sample and interpolating from there, possibly
being the cause of the random "audio pops").
Rewrite most of the AudioCommon mixer

Instead of implementing a ring buffer ourselves in the mixer code, make
that code generic and add it in Common/RingBuffer.h.

Perform the endian swapping and RL -> LR while pushing samples instead of
doing it while reading samples.

Use the common resampling code for linear interpolation: I *think* this
should fix the issue with random "pops" in sound when playing.
Fix the RingBuffer implementation

* ReadableCount() previously returned wrong values: for example:

    0 1 2 3 4 5 6 7 8 9        N=10
        W     R

  There are 7 readable elements (5,6,7,8,9,0,1), but ReadableCount() previously
  returned (r - w) which is 3.

* WritableCount() allowed the buffer to get full even though the RingBuffer API
  specified that you should never let the buffer fill up.
Fix the Mixer issues reported by degasus

* Swap and exchange samples in the audio thread instead of the CPU thread.
* Move static variables to class instance variables.
* Pad incomplete buffers by repeating the last value instead of 0.