Fix crash when non-standard USER environment variable is not set