Fix #23305 - replace incorrect logger returned from the inside of withDeferredDiagnostics
The log_hook of logger in HscEnv is temporarily appended inside withDeferredDiagnostics and the hook is removed in finalizer of bracket. But the returned HscEnv from the upsweep call contains that transient state of the logger. This results in swallowing error messages with -fdefer-diagnostics reported in #23305 (closed). In this patch, the original logger is reinstated when setting the new environment with the result of upsweep.