Fix segfault when an error occurs before the error handler is initialized.