Restore original error/exception handlers for tests