Properly store the dialogs which belong to shared profiles when saving them in the DB
Properly re-link the shared profiles to the dialog at startup
(cherry picked from commit bca28801830dccac2c0baaaabf08b5909dc5aaf1)