Fix bug 958977

Make mock and mock-plugin use ENV hooks for environment variables.