Align environment changes from the core.

Change-Id: I638e38e02e66cb8cc49546c47522131533f62560
Reviewed-on: http://review.couchbase.org/40794
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>