Added checks to ensure alsa_open returns a valid object, Fix #282