Resource deallocation

Here is a sample test as well as the revert of the commit for the closing of the sockets.
Please note that the unit test does not end with Test so it will not be running in automatic testing, as this kind of stress test may need to run for a long period of time.

This exact same test can be used on my machine to detect resource deallocation problems in sockets as well as in polling