Fix test mocks for TCPSocket cases