ios: Don't remove sockets from dictionary while iterating over it