Switched the order of the checks to reduce the overhead. Async unsafe methods are *normally* called syncrhonously, so we can avoid the overhead of checking the environment variable in the regular path.