Wait for SHUTDOWN and close socket after it