Solved by setting a HTTP header to close the connection instead of default keep-alive strategy.

res.set("Connection", "close");

In case someone who really wants just to close the connection finds this, you can use res.socket or res.connection to get the net.Socket object which comes with a destroy method:

res.connection.destroy();