Fix camera zoom CTS bug.

The test starts from the camera id 0. If the zoom is not supported,
camera 0 is not released and the CTS starts to test id 1. The
camera should be released before testing the next one.

bug:5144206

Change-Id: I72b204eaa3f399ae09a4529f2acd84bfa4f00438
diff --git a/tests/tests/hardware/src/android/hardware/cts/CameraTest.java b/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
index 195589f..897481a 100644
--- a/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
+++ b/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
@@ -1177,7 +1177,10 @@
         initializeMessageLooper(id);
 
         Parameters parameters = mCamera.getParameters();
-        if (!parameters.isZoomSupported()) return;
+        if (!parameters.isZoomSupported()) {
+            terminateMessageLooper();
+            return;
+        }
 
         // Test the zoom parameters.
         assertEquals(0, parameters.getZoom());  // default zoom should be 0.
@@ -1254,7 +1257,10 @@
         initializeMessageLooper(id);
 
         Parameters parameters = mCamera.getParameters();
-        if (!parameters.isSmoothZoomSupported()) return;
+        if (!parameters.isSmoothZoomSupported()) {
+            terminateMessageLooper();
+            return;
+        }
         assertTrue(parameters.isZoomSupported());
 
         ZoomListener zoomListener = new ZoomListener();