Fix error when unsetting nonexistent environment variable in tests