tcpsocket: add a protection against socket re-initialization.