Handle closed connection in Node.js task worker