Fixed issues involving application termination. This fixed the applet launch hang after launching a ctrulib app, and fixed the issue where the power/HOME buttons did not work correctly under the power-off screen.