replayserver: Avoid multiple calls to getenv