Arranged the code to be more simple.
Fixed the crash on taking a picture.

Users reported that some devices cause the following error::

    java.lang.RuntimeException: takePicture failed
        at android.hardware.Camera.native_takePicture(Native Method)

I could not reproduce this error. But some web sites told that this
might due to the internal buffer of a camera.

* http://stackoverflow.com/questions/7627921/android-camera-takepicture-does-not-return-some-times
* https://code.google.com/p/android/issues/detail?id=13966