Bug Fixes

- result of audio_manager_snd_pcm_open_name() is now tested tested
- The results of snd_pcm_plugin_enable() / snd_pcm_plugin_disable()
shouldn’t be tested against ‘< 0’.
-Use SND_PCM_START_DATA for capture

-snd_pcm_plugin_prepare() is being called twice irrespective of the
status returned
- Moved the writeToCircularBuffer(), where read was successful.
- total_written+= written should be in ‘else’ so it doesn’t get updated
if write fails