Set all variables using just one shell invocation

This dramatically speeds things up, and requires only the assumption
that none of the names or values of the environment variables contains
a null character.