Avoid modifying the volume attachments collection while iterating through it.

Fixes EUCA-6082