[v9_11] Fix cleanup upon an error before TCP socket creation

Closes #692 (closed)

Merge request reports