Fixed segfaults on attempt to connect to nxt by tcp thread