AppRTCDemo(Android): only stop the cameraThread's looper after stopping the camera.

R=glaznev@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/20569004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6358 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureAndroid.java b/webrtc/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureAndroid.java
index c8abdbe..5ae70fc 100644
--- a/webrtc/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureAndroid.java
+++ b/webrtc/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureAndroid.java
@@ -219,7 +219,6 @@
   private void stopCaptureOnCameraThread(
       Exchanger<Boolean> result) {
     Log.d(TAG, "stopCapture");
-    Looper.myLooper().quit();
     if (camera == null) {
       throw new RuntimeException("Camera is already stopped!");
     }
@@ -243,6 +242,7 @@
       error = e;
     }
     Log.e(TAG, "Failed to stop camera", error);
+    Looper.myLooper().quit();
     exchange(result, false);
     return;
   }