Fix shutdown of sample app

We have to call Xpcom.Shutdown() when exiting the application,
otherwise it hangs on Linux.