Properly terminate PortAudio when closing