fix account migration wizard

This fixes a couple of issues and potential crashes:
- the account state changes signal was not being disconnected before
  calling reload on the account which causes a state change and so the
  handler was being called twice
- when migating multiple accounts, the wizard view would not be
  destoryed immediately when calling gtk_container_remove() and so it
  was possible to have 2 views in the GtkStack with the same name

This also removes the weak ptr reference to the migration view. It is
not necessary since the only time the view is destroyed is when we
explicitly do so in the handle_account_migrations() function.

Tuleap: #1121
Change-Id: I448db725193f7c566378298f52f5bad818dbd492
diff --git a/src/ringmainwindow.cpp b/src/ringmainwindow.cpp
index c805e2e..89d00d9 100644
--- a/src/ringmainwindow.cpp
+++ b/src/ringmainwindow.cpp
@@ -1013,17 +1013,16 @@
     /* If there is an existing migration view, remove it */
     if (priv->account_migration_view)
     {
-        gtk_container_remove(GTK_CONTAINER(priv->stack_main_view), priv->account_migration_view);
+        gtk_widget_destroy(priv->account_migration_view);
+        priv->account_migration_view = nullptr;
     }
 
     QList<Account*> accounts = AccountModel::instance().accountsToMigrate();
     if (!accounts.isEmpty())
     {
         Account* account = accounts.first();
-        g_debug("Migrating account: %s", account->id().constData());
 
         priv->account_migration_view = account_migration_view_new(account);
-        g_object_add_weak_pointer(G_OBJECT(priv->account_migration_view), (gpointer *)&priv->account_migration_view);
         g_signal_connect_swapped(priv->account_migration_view, "account-migration-completed", G_CALLBACK(handle_account_migrations), win);
         g_signal_connect_swapped(priv->account_migration_view, "account-migration-failed", G_CALLBACK(handle_account_migrations), win);