Fix S3 cache environment variable usage

This should also fix the failing test on travis.