Prevent concurrent modification exception when resending failed messages.