I already asked about this on the mailing list, but I didn't get an answer, that's why I open a ticket now.
I stumbled over some libcurl code, that seems strange to me: in function Curl_closesocket() in connect.c the call to Curl_multi_closed() is omitted if a socket close function (CURLOPT_CLOSESOCKETFUNCTION) is registered.
My understanding is that the behavior with and without a registered close function (that only calls close(sock)) should be the same.
I haven't tested anything, it just caught my eye. So could this be a problem?
I would propose something like the attached patch