SocketList: Fix bug with the cleanup of empty list
SocketList: Add lock variable for the RemoveSockets method