Fix chat socket descriptor leak and statistics
Also removes unused and non-working code.
The socket descriptor array was ever growing because the removal did not work. This lead to incredible memory usage over time and slow statistics response times.