Implement res 'close' event and fix identation.