mainwindow: Close the previewer only when the user pressed ESC or Q

The main problem was that if the user tries to click the playback bar to
play at a different position, it happens too often to get the mouse
cursor outside of the window and then the dialog was closing.

- Also allow using SPACE to toggle playback.
- Also moved the preview UI logic to a new PreviewAssetWindow class.