fix some breakages from open ai updates
change to optimistic locking. No longer relies strictly on the last modified for the locking, but an integer. This should fix the occasional out of sync error that would occur when saves would happen back to back and htmx hadn't return the server last modified time. The save count is updated on the front end, so it should stay in sync and only go out of sync if another client updates it.