Added a waiting mechanism for the playback threads using condition variables.
This commit drops cpu load below 100%, but some residual bottle-necking occurs during the last couple
seconds of playback of non-looping samples.