add_message: Fix to not add multiple documents with the same message ID