Handle fwrite() failure early.
Handle fwrite() failure early.

damoxc/dovecot,Distrotech/dovecot,Distrotech/dovecot,damoxc/dovecot,damoxc/dovecot,damoxc/dovecot,damoxc/dovecot,Distrotech/dovecot,Distrotech/dovecot,Distrotech/dovecot