fn drain_log_queue_if_available()Expand description
Drain the cross-thread log queue if the log feature is enabled.
This is called at every exit point of run_r_unwind_protect (normal
return, Rust panic, and immediately before R_ContinueUnwind) so that
worker-thread log records always reach R’s console before the FFI call
returns or re-raises an R error.
When the log feature is disabled this compiles to a no-op; there is
no runtime overhead.