Clean-up of 'client' should be done in main thread. 

I found an issue, described as follows:

As the worker thread quits, it marks the client state as 'PC_ST_CLOSED'. Then it iterates thru the listener list to broadcast its demise,   while pc_client_destroy (in the main thread) cleans up the 'listeners', which leads to memory corruption.