Catch errors while processing listeners

 * The 503 in bug 71880 is from an uncaught exception along this path
   terminating the connection without sending a response.

 * This pattern of logging fatal feels really icky but since we're doing
   elsewhere in the codebase may as well continue until we deal with it
   systematically.

 * The root of the error itself is that the typo in change
   I84ac4773102be18a461f8bc7d3eb227beef0b83f was resulting in a dom
   attribute name with a quote " in it. That's invalid in html5 and
   domino is justified in throwing a "INVALID_CHARACTER_ERR (5): the
   string contains invalid characters". Our tokenizer wouldn't have
   produced this but the content that it comes from is ostensibly from
   expanded templates where we rely on the php parser to have done that
   sanitization. However, in this particular case, we're injecting our
   own raw html that happened to be malformed. I'm thinking the real fix
   is to not do this construction with strings but use actual dom
   fragments and then serialize them before the injection.

Change-Id: Iae2f3bf90b13f83411432e06e2ee7e188f34bb43