Set out stream to null if control socket fails to connect

Set out stream to null if control socket fails to connect.
This helps in avoiding wrong usage of audio device out stream
even after the same is freed as part of control socket connection
failure.

Change-Id: I8e2a7bbc71d581525b7eef1955e411c220d01627
diff --git a/audio_a2dp_hw/audio_a2dp_hw.c b/audio_a2dp_hw/audio_a2dp_hw.c
index 5f4c14c..bfd2226 100644
--- a/audio_a2dp_hw/audio_a2dp_hw.c
+++ b/audio_a2dp_hw/audio_a2dp_hw.c
@@ -941,6 +941,7 @@
 err_open:
     free(out);
     *stream_out = NULL;
+    a2dp_dev->output = NULL;
     ERROR("failed");
     return ret;
 }
@@ -970,8 +971,10 @@
     int retval = 0;
 
     if (out == NULL)
+    {
+        ERROR("ERROR: set param called even when stream out is null");
         return retval;
-
+    }
     INFO("state %d", out->state);
 
     retval = out->stream.common.set_parameters((struct audio_stream *)out, kvpairs);