Fix exit

https://groups.google.com/forum/#!topic/osmand/tgdBv_-ht3E
Merge pull request #401 from Zahnstocher/patch-7

Fix exit