Thread attributes are copied in pth_spawn() so it's safe to reuse the
attr object.
Reset a connection thread priority to standard in socket_thread()
because threads inherit attributes.
Be nicer about terminating the socket_thread. Check for an exception
in the event and terminate the thread if theres an pth_accept() error.
This will occur when a terminating signal is sent which closes the
socket file descriptor.
Added xdump() to mem.c which shows not-freed pointers which is enabled
when DEBUG is defined.