Use 'env' in tests that set environment variables.

Patch by David Fang!