Fix the compile error with ERAttachmentUploadQueue (closes #545)

The current implementation doesn't require unchecked casts and compiles correctly with JDK 6 and JDK 7.