If the PDFDoc creation failed in driver.js then that was not informed back to
test.py. This lead to State.remaining being off by one. And that did not let
the test to end as expected. Instead the test hung indefinitely.
This change now reveals TEST-UNEXPECTED-FAIL which was hidden previously.
Currently the innerHTML is replaced with text:
Tests are finished.
CLOSE ME!
Instead of replacing the innerHTML prepend that text to it.
This way the user can still check the results of the test.
If nextTask leaves task.pdfDoc as undefined then sendTaskResult will fail on
that. SendTaskResult tries to access task.pdfDoc.numPages which cannot
succeed. This leads to a complete stop in the browser-test.