Alsa fix double free

* Fixes issue #1490
* Fixes compiler warnings in module.