pub unsafe fn with_protect_scope<F, R>(f: F) -> Rwhere F: FnOnce() -> R,
Execute a closure with a protect scope that is accessible via TLS.
Must be called from the R main thread.