Fixed crashes related to noise sensor.

- setting the prefered audio input was related to an occasional crash
- on interrupted audio, with 0 samples a NaN caused an uncaught exception