async def close(self):
if self.writer is None:<EOL><INDENT>return<EOL><DEDENT>await self.flush()<EOL>self.writer.close()<EOL>
Tidy up any resources used by the handler.

This version removes the handler from an internal map of handlers,
should ensure that this gets called from overridden close()
methods.