Fix MaterialApp's _navigatorObserver so it doesn't cause WidgetApp's assertion to fail when using custom navigator, fixes #18904