Refactored to work with OS X

[Fixed] - Error: "socket.error: [Errno 48] Address already in use" on OS X
[Changed] - socket import and all subsequent calls to the socket module. Although the code is less readable, it made pyncp functional on Mac OS X latest version (10.8.4).