Use optimistic locking to put DynamoDB records with auto-incrementing attributes. Python port of https://github.com/nasa-gcn/dynamodb-autoincrement