backport from trunk (rev #9894)

fixed dlg_db_sync to match the recent dialog.id table changes