Always store a reference to the application object.

Always store a reference to the application object.

It would not happen if we started with `app=None` and afterwards call `.init_app()`.