Improve error checking

Detect write errors (both on the database and to the WARC output) and
abort with an error message.

Also fix a bunch of harmless lint warnings.
1 job for master in 14 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Test
passed #3741
run_tests

00:00:14