Check that we still have a write buffer after dispatching alerts

CVE-2014-0198

PR: 3321