cache the call to getenv

Change-Id: I13095b13694aa092e3d5f542b5be12e703eb4590
the DUMMY_CHART_FACTORY variable is not the only indicator for OpenGl charts

Change-Id: Idab33c8611526dc4749b4dbe4fe84e68138b4f73