Clean up some access to null objects in the demo.

just moved stuff around to quiet error messages.
This isn't going to work for applications that use CSDs when embedded window controls on the right of the toolbar. Can you try moving this to the code that animates the action bar (in `Toolbar.qml`), and set it to toolbar.right/left? Then we can easily update that once we implement embedded window controls.