Fixed bug in exit

Fixed bug app not exit clean when pressing the exit-button before
closing camera-capture