[Big one]: WriteTex was incorrectly setting job_id to 0 before CompileTex could complete

As a result, a quiz would get enabled before its preview was fully ready
or its sample made