Improved portaudio example

Two major flaws were fixed in the example code of portaudio;

- When buffer is not of expected size, it would crash
- Varying sample rate and / or channels are now supported

The example program should now also properly exit the program once the
full track has been played.