Python: Catch and cope with unknown exceptions in the scanner

This is to avoid the scanner getting stuck when the client gets an error
from the server or a certificate's parsing fails with an unknown exception.
While there is no recovery for LogClient errors, at least the scanner
will not get wedged and the error will be obvious in the output.