Camera: Disconnect composite streams from output surface at shutdown

When a composite stream is deleted, the previously connected output
surface needs to be disconnected. Otherwise when the composite stream is
re-created with the same output surface, connect() will fail.

Test: TestingCamera2, and Camera CTS
Bug: 79465976
Bug: 109735087
Bug: 124072769
Change-Id: I254238235d306f9be8152110b1c55a7ada46424a
diff --git a/services/camera/libcameraservice/api2/DepthCompositeStream.cpp b/services/camera/libcameraservice/api2/DepthCompositeStream.cpp
index f627b25..2eec0f7 100644
--- a/services/camera/libcameraservice/api2/DepthCompositeStream.cpp
+++ b/services/camera/libcameraservice/api2/DepthCompositeStream.cpp
@@ -634,6 +634,11 @@
         mDepthStreamId = -1;
     }
 
+    if (mOutputSurface != nullptr) {
+        mOutputSurface->disconnect(NATIVE_WINDOW_API_CAMERA);
+        mOutputSurface.clear();
+    }
+
     return ret;
 }