Bluetooth A2DP suspend-resume improvements.

This change will reduce the occurence rate of A2DP sink suspend resume failures observed in issues 2184627, 2181005 and possibly 2189628.

Avoid lockups in case of BT device disconnection during the A2DP start process by using a timeout when reading from bluetooth command socket.
Correct a typo causing potential deadlock in wait_for_start().
diff --git a/audio/liba2dp.c b/audio/liba2dp.c
index d8f5bc8..7dcfc9d 100755
--- a/audio/liba2dp.c
+++ b/audio/liba2dp.c
@@ -88,6 +88,9 @@
 /* timeout in milliseconds for a2dp_write */
 #define WRITE_TIMEOUT			1000
 
+/* timeout in seconds for command socket recv() */
+#define RECV_TIMEOUT            5
+
 
 typedef enum {
 	A2DP_STATE_NONE = 0,
@@ -786,6 +789,7 @@
 static int bluetooth_init(struct bluetooth_data *data)
 {
 	int sk, err;
+        struct timeval tv = {.tv_sec = RECV_TIMEOUT};
 
 	DBG("bluetooth_init");
 
@@ -795,6 +799,8 @@
 		return -errno;
 	}
 
+        setsockopt(sk, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
+
 	data->server.fd = sk;
 	data->server.events = POLLIN;
 	data->state = A2DP_STATE_INITIALIZED;
@@ -919,7 +925,7 @@
 	pthread_mutex_lock(&data->mutex);
 	while (state != A2DP_STATE_STARTED) {
 		if (state == A2DP_STATE_NONE)
-			set_command(data, A2DP_CMD_INIT);
+			__set_command(data, A2DP_CMD_INIT);
 		else if (state == A2DP_STATE_INITIALIZED)
 			__set_command(data, A2DP_CMD_CONFIGURE);
 		else if (state == A2DP_STATE_CONFIGURED) {