Fix race condition with multiple messages that have the same ID

Addresses #134, #136, and adobe-photoshop/generator-assets#182

@iwehrman Thanks for your thoughts on how to fix this. Care to give it a review?