Tracking down of some memory leaks using valgrind + making main return rather than exit() so we get better data from valgrind. Also some c++isms in the alsa driver.