occasionally creating or saving a job fails with the error:
can't find a repeatable reproduction of this issue, but based on the code I think there is a race condition when two threads attempt to serialize the same job, which can happen when a job is created/saved. one thread is triggered by the event system listening for job changes, and one by the GUI as it redirects the user to the job view page after saving.
the threads would step on each other when writing to the same temp file, and subsequently replacing the target file.
fix is to avoid writing to the same temp file, avoid writing the same job at the same time, and avoid re-serializing the job if the same or later revision has already been serialized
test updates for #1931 test serialize same/older revision
fix #1931 avoid race/contention serializing job to temp file