Improve handling of environment variables.

Prevent scram runtime script from choking on 'unset' on invalid lines in the environment.

From Andrew Melo @PerilousApricot