Change to socket {active,once} earlier in order to receive the tcp_close