Clear page stack when entering closed state
Before setting AppState.setClosed(), clear the page stack of everything but MainPage. This not only frees resources, but sets the "closed" application in a known state. Most notably, it stops video playback if such was ongoing.
Fixes #547 (closed)