Fix issue where a socket in asyncore.map was closed during asyncore.poll
Fix issue where concurrent task counter mutex was not released due to uncaught exception