Avoid to close the already closed socket

This should be the initial value (= 0)