Allow sync clients to defer delivery of messages
This branch allows sync clients to respond to the delivery of a message by deferring delivery until the next time the app starts. This was already possible by throwing a DbException, but this branch makes the behaviour "official", and also fixes a bug in the handling of DbExceptions (if a client threw a DbException during delivery of a pending message at app startup, the delivery of other pending messages would be delayed until the next startup).
Part of #1802 (closed).