fix for narrow timing issue that occurs when the check for a document existence fails, but then the document appears in the cluster before the script is able to put the document, causing a 409 Conflict (#5523)