fix init_app

fixed init_app to set the state, so that `mail.init_app(app)` works instead of saying `mail = mail.init_app(app)`