Detect "clean socket shutdowns" and stop waiting on the socket