Fix for exiting the app when applying an update

The final touch for the revamped UpdateManager. Exiting the app
correctly before applying an update needs to be done from the main
thread.
Fixes #132.