Clean up some access to null objects in the demo.

just moved stuff around to quiet error messages.
Actually, this is looking much harder than I first thought.  Right now the transition is swapping parents around quite a bit.  I wonder if it wouldn't be better to abandon this PR, and focus on first making the transitions implement the Transition component and then use the "states" and "transitions" properties to manage them.  I think this will remove the need to have references back to the Page and PageStack.  This would also allow us to leverage the built in transition states inside of the QtQuick.Controls StackView.  Thoughts?