Make setting env variables idempotent

[Finishes #62883182]