pub(crate) fn with_napi_env<F, R>(env: &Env, f: F) -> Rwhere F: FnOnce() -> R,
Sets the NAPI env for the duration of a closure, then clears it.