core: also stop emqtt before stopping mnesia.