loader: make env_discard() public
remove static from env_discard() to make it globally available. Needed to unset variable without using callback. While there, also perform cstyle cleanup.
Testing done: build.