Better handling of closing HTTP connections.