update listener cursor handling

Signed-off-by: Jan Dvořák <mordae@anilinux.org>
fix dbdict parent fkey protection

We were looking for parents of top-level endpoints.

Signed-off-by: Jan Dvořák <mordae@anilinux.org>
implement database change corking

With this in place the changes we receive from the database are always
bundled per-transaction, which can be used later on to make model
consistent.

Signed-off-by: Jan Dvořák <mordae@anilinux.org>