Update hexchat.py

The program would sometimes not connect properly. This was fixed by setting the socket to blocking, using the connect() function, then setting the socket to nonblocking. There may be cleaner ways of handling connections inside threads, and this section of the code may be tweaked further.