dialog: fix primary key when updating dialogs in REALTIME db mode

When updating rows in the dialog table in REALTIME db mode, the dlg_id
update key is not properly initialized (actually contains random data).

Reported by miko95 on GitHub
Closes issue #306
(cherry picked from commit 0ad3e4f949e1d669d53cd584e48b7d2eff740a22)