Call ErrorHandler::unregister() instead of restore_*_handlers directly