Fixes: [38399] Properly handle closing sockets during a select call
