dsync: Potential crashfix, plus some compiler warning fixes.
dsync: Potential crashfix, plus some compiler warning fixes.

--HG--
branch : HEAD

dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot