Listen to `res.on('finish')` instead of monkey patching the `res.end` method.