config: only clear current_devices when stream refcount is zero

release_stream() should only clear current_devices() if the
stream reference count becomes zero.

Change-Id: I350e413350e5cf884ea2e29dc4c49f3d0e04c632
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
diff --git a/audio_config.c b/audio_config.c
index 4d2dec3..885bcfd 100644
--- a/audio_config.c
+++ b/audio_config.c
@@ -666,8 +666,8 @@
             apply_paths_to_devices_l(s->cm, s->current_devices,
                                     e_path_id_off, s->disable_path);
             apply_paths_to_global_l(s->cm, s->disable_path, e_path_id_off);
+            s->current_devices = 0;
         }
-        s->current_devices = 0;
         pthread_mutex_unlock(&s->cm->lock);
     }
 }