Expand PATH before writing to environment